CCCPaste

Dom Menü

monitor = peripheral.wrap("monitor_1")
function pos(...) return term.setCursorPos(...) end
function cls(...) return term.clear() end
function tCol(...) return term.setTextColor(...) end
function bCol(...) return term.setBackgroundColor(...) end
function box(...) return paintutils.drawFilledBox(...) end
function line(...) return paintutils.drawLine(...) end
function write(...) return term.write(...) end
term.redirect(monitor)
w, h = monitor.getSize()
local foundrya = require("foundry")
local dyea = require("dye")


function getSize() w,h = monitor.getSize() end
tCol(colors.white)
local andes = false
local darkmode = true
local darkmodec

local boolArray = {false, false, false, false, false, false, false, false, false, false, false, false, false}

------------------------------------------------------------

function drawMenu()
    monitor.setTextScale(2)
    getSize()
    bCol(colors.blue)
    if darkmode then
        box(1,1,w,h,colors.blue)
    else
        box(1,1,w,h,colors.blue)
    end
    
    pos(w/2-#"MENU"/2,1)
    write("MENU")

    monitor.setBackgroundColor(colors.lightGray)
    pos(5,3)
    write("FOUNDRY")
    pos(5,6)
    write("DYE")
    pos(5,9)
    write("BLOCKS")
    pos(5,12)
    write("LOG")
    pos(5,15)
    write("BASICS")
    pos(w/2,3)
    write("BRF1")
    pos(w/2,6)
    write("NETHER")
    pos(w/2,9)
    write("ELECTRONICS")
    pos(w/2,12)
    write("BRF2")
    pos(w/2,15)
    write("IRF")
    pos(1,17)
    bCol(colors.black)
    write("EXIT")
    bCol(colors.blue)

end

function main()
    drawMenu()
    
    while true do
    
        local event, button, mx, my = os.pullEvent()
        if event == "monitor_touch" then
        
            if mx >= 5 and mx <= (5+#"FOUNDRY") and my == 3 then
                foundrya.foundry()
                if foundrya.foundry() == "menu" then
                    drawMenu()
                end
            end
            if mx >= 5 and mx <= (5+#"DYE") and my == 6 then
                dyea.dye()
                if dyea.dye() == "menu" then
                    drawMenu()
                end
            end
        end
    end 
end

--------------------------------------------------------------

main()
return {main = main}