Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- FS_UI = Window:new(100, 100, 437, 155)
- title = Label:new(20, 10, 200, 16, "\bo**** FALLING SAND EDITOR ****")
- elementdesc = Label:new(10, 65, 100, 16, "\bbElement coming out")
- widthdesc = Label:new(10, 95, 100, 16, "\bbWidth of stream (pix.)")
- ach = Checkbox:new(120, 40, 16, 16, "\brStream 1")
- ach:checked(true)
- bch = Checkbox:new(200, 40, 16, 16, "\brStream 2")
- bch:checked(true)
- cch = Checkbox:new(280, 40, 16, 16, "\brStream 3")
- cch:checked(true)
- dch = Checkbox:new(360, 40, 16, 16, "\brStream 4")
- dch:checked(true)
- STRONE = Textbox:new(120, 65, 67, 16, "", "Element here")
- STRTWO = Textbox:new(200, 65, 67, 16, "", "Element here")
- STRTHREE = Textbox:new(280, 65, 67, 16, "", "Element here")
- STRFOUR = Textbox:new(360, 65, 67, 16, "", "Element here")
- SIZEONESL = Slider:new(120, 90, 67, 16, 32)
- SIZEONESL:value(4)
- SIZEONESL:onValueChanged(
- function()
- SIZEONE:text(SIZEONESL:value())
- end
- )
- SIZETWOSL = Slider:new(200, 90, 67, 16, 32)
- SIZETWOSL:value(4)
- SIZETWOSL:onValueChanged(
- function()
- SIZETWO:text(SIZETWOSL:value())
- end
- )
- SIZETHREESL = Slider:new(280, 90, 67, 16, 32)
- SIZETHREESL:value(4)
- SIZETHREESL:onValueChanged(
- function()
- SIZETHREE:text(SIZETHREESL:value())
- end
- )
- SIZEFOURSL = Slider:new(360, 90, 67, 16, 32)
- SIZEFOURSL:value(4)
- SIZEFOURSL:onValueChanged(
- function()
- SIZEFOUR:text(SIZEFOURSL:value())
- end
- )
- SIZEONE = Label:new(120, 105, 67, 16, "")
- SIZETWO = Label:new(200, 105, 67, 16, "")
- SIZETHREE = Label:new(280, 105, 67, 16, "")
- SIZEFOUR = Label:new(360, 105, 67, 16, "")
- closeButton = Button:new(10, 128, 417, 16, "\btFINISH")
- closeButton:action(function() interface.closeWindow(FS_UI) end)
- settingsclassic = Button:new(247, 10, 85, 16, "\btCLASSIC MODE")
- settingsclassic:action(function() classic() end)
- reset = Button:new(342, 10, 85, 16, "\btRESET ALL")
- reset:action(function() resetAll() end)
- function open(key)
- if key == "o" then
- interface.showWindow(FS_UI)
- end
- end
- function classic()
- ach:checked(true)
- bch:checked(true)
- cch:checked(true)
- dch:checked(true)
- STRONE:text("dust")
- STRTWO:text("watr")
- STRTHREE:text("salt")
- STRFOUR:text("oil")
- SIZEONESL:value(8)
- SIZETWOSL:value(8)
- SIZETHREESL:value(8)
- SIZEFOURSL:value(8)
- SIZEONE:text("8")
- SIZETWO:text("8")
- SIZETHREE:text("8")
- SIZEFOUR:text("8")
- end
- function resetAll()
- ach:checked(true)
- bch:checked(true)
- cch:checked(true)
- dch:checked(true)
- STRONE:text("none")
- STRTWO:text("none")
- STRTHREE:text("none")
- STRFOUR:text("none")
- SIZEONESL:value(4)
- SIZETWOSL:value(4)
- SIZETHREESL:value(4)
- SIZEFOURSL:value(4)
- SIZEONE:text("4")
- SIZETWO:text("4")
- SIZETHREE:text("4")
- SIZEFOUR:text("4")
- end
- function FallingSand()
- if STRONE:text() == "" or STRONE:text() == "0" then
- STRONE:text("none")
- end
- if STRTWO:text() == "" or STRTWO:text() == "0" then
- STRTWO:text("none")
- end
- if STRTHREE:text() == "" or STRTHREE:text() == "0" then
- STRTHREE:text("none")
- end
- if STRFOUR:text() == "" or STRFOUR:text() == "0" then
- STRFOUR:text("none")
- end
- if SIZEONE:text() == "" then
- SIZEONE:text("4")
- end
- if SIZETWO:text() == "" then
- SIZETWO:text("4")
- end
- if SIZETHREE:text() == "" then
- SIZETHREE:text("4")
- end
- if SIZEFOUR:text() == "" then
- SIZEFOUR:text("4")
- end
- local ox = 125
- local y = 4
- local x = ox
- if ach:checked() == true then
- for i = 1, SIZEONE:text() do
- if tpt.get_property("type", x + i, y) == 0 and STRONE:text() ~= "none" then
- tpt.create(x + i, y, STRONE:text())
- end
- end
- end
- x = x + ox
- if bch:checked() == true then
- for i = 1, SIZETWO:text() do
- if tpt.get_property("type", x + i, y) == 0 and STRTWO:text() ~= "none" then
- tpt.create(x + i, y, STRTWO:text())
- end
- end
- end
- x = x + ox
- if cch:checked() == true then
- for i = 1, SIZETHREE:text() do
- if tpt.get_property("type", x + i, y) == 0 and STRTHREE:text() ~= "none" then
- tpt.create(x + i, y, STRTHREE:text())
- end
- end
- end
- x = x + ox
- if dch:checked() == true then
- for i = 1, SIZEFOUR:text() do
- if tpt.get_property("type", x + i, y) == 0 and STRFOUR:text() ~= "none" then
- tpt.create(x + i, y, STRFOUR:text())
- end
- end
- end
- end
- FS_UI:addComponent(title)
- FS_UI:addComponent(elementdesc)
- FS_UI:addComponent(widthdesc)
- FS_UI:addComponent(ach)
- FS_UI:addComponent(bch)
- FS_UI:addComponent(cch)
- FS_UI:addComponent(dch)
- FS_UI:addComponent(STRONE)
- FS_UI:addComponent(STRTWO)
- FS_UI:addComponent(STRTHREE)
- FS_UI:addComponent(STRFOUR)
- FS_UI:addComponent(SIZEONESL)
- FS_UI:addComponent(SIZETWOSL)
- FS_UI:addComponent(SIZETHREESL)
- FS_UI:addComponent(SIZEFOURSL)
- FS_UI:addComponent(SIZEONE)
- FS_UI:addComponent(SIZETWO)
- FS_UI:addComponent(SIZETHREE)
- FS_UI:addComponent(SIZEFOUR)
- FS_UI:addComponent(closeButton)
- FS_UI:addComponent(settingsclassic)
- FS_UI:addComponent(reset)
- tpt.register_keypress(open)
- tpt.register_step(FallingSand)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement