events.listen('ui.main_menu', event => {
  event.replace(ui => {
    ui.panorama("minecraft:textures/gui/title/background/panorama")
    ui.shaderBackground("mainmenu:main_menu")
    ui.minecraftLogo(30)

    //SLCP5 version
    ui.label(l => {
        l.height = 10
        l.name = 'SLCP5 0.20'
        l.x = 3
        l.y = ui.height - 51
    })

    //world version
    ui.label(l => {
        l.height = 10
        l.name = 'Worldgen 5.2'
        l.x = 3
        l.y = ui.height - 41
    })

    ui.label((l) => {
        l.height = 6
        l.name = Text.of([text.translate('menu.animation') + " ", ui.useShaders ? "☑" : "☐"])
        l.x = 3
        l.y = 3
        l.action = "kubejsui:toggle_shaders"
        l.hoverText = text.translate('menu.animationhover')
    })

    //single player
    ui.button(b => {
        b.name = text.translate('menu.singleplayer')
        b.width = 200
        b.x = (ui.width - b.width) / 2
        b.y = ui.height / 2 - 24
        b.action = 'minecraft:singleplayer'
    })

    //multi player
    ui.button(b => {
        b.name = text.translate('menu.multiplayer')
        b.width = 200
        b.x = (ui.width - b.width) / 2
        b.y = ui.height / 2 - 0
        b.action = 'minecraft:multiplayer'
    })

    //mods
    ui.button(b => {
        b.name = text.translate('fml.menu.mods')
        b.width = 98
        b.x = ui.width / 2 - b.width - 2
        b.y = ui.height / 2 + 24
        b.action = 'forge:mod_list'
    })

    //bh
    ui.button(b => {
        b.name = text.translate('menu.bh')
        b.width = 98
        b.x = ui.width / 2 + 2
        b.y = ui.height / 2 + 24
        b.action = "https://bisecthosting.com/frankV"
        b.hoverText = text.translate('menu.bhhover')
    })

    //option
    ui.button(b => {
        b.name = text.translate('menu.options')
        b.width = 98
        b.x = ui.width / 2 - b.width - 2
        b.y = ui.height / 2 + 57
        b.action = 'minecraft:options'
    })

    //quit
    ui.button(b => {
        b.name = text.translate('menu.quit')
        b.width = 98
        b.x = ui.width / 2 + 2
        b.y = ui.height / 2 + 57
        b.action = 'minecraft:quit'
    })

    //forge version
    ui.label(l => {
        l.height = 10
        l.name = 'Forge ' + Platform.mods.forge.version
        l.x = 3
        l.y = ui.height - 31
    })

    //MC version
    ui.label(l => {
        l.height = 10
        l.name = 'Minecraft 1.16.5' 
        l.x = 3
        l.y = ui.height - 21
    })

    //mods loaded
    ui.label(l => {
        l.height = 10
        l.name = Platform.mods.size() + ' Mods Loaded'
        l.x = 3
        l.y = ui.height - 11
    })

    //mojang
    ui.label(l => {
        l.height = 10
        l.name = 'Copyright Mojang AB'
        l.x = ui.width - l.width - 3
        l.y = ui.height - 11
    })
  })
})