// Here is the groovy file for screen elements
info("Hello From 'Slight' Gui Modifications cts script")

mainMenu {
    enabled = true // Set to true to enable this module

    splashText {
        enabled = false // Set to true to enable this module
        splashesEnabled = false // Set to false to disable splashes entirely

        customSplashes {
            enabled = false // Set to true to enable this module
            // You can put either "override" or "append" here to declare how you want to provide custom splashes
            applyMode = "override"
            defineCustom(["Wood", "Potato", "Stone"])
        }
    }

    background {
        clearBackgrounds() // This line removes the rotating cube
        backgroundStayLength = 10000 // This sets the length a background would stay
        backgroundFadeLength = 10000 // This sets the fade duration to another background
        renderGradientShade = false // This sets whether the slight shade should be rendered
        image {
            texture = file("config/slightguimodifications/background.png") // Remember to use forward slash to support unix!
            texture = resource("slightguimodifications:background.png") // Here to use a resource location / identifier
        }
    }

    // Uncomment these to remove aspects of the title screen
     removeMinecraftLogo()
     removeEditionBadge()

    // Clear all buttons already on screen
     clearAllButtons()

    // Clear all labels already on screen
    // clearAllLabels()

     label {
        position {
            x = 2
            y {
                it - 20
            }
        }

        text = literal("Erratic Craft")
   }

    button {
        position {
            x { it / 2 + 3 }
            y = 203
        }
        width = 100
        height = 20

        text = modMenuText()
        onClicked = modMenu()
    }
    button {
        position {
            x { it / 2 - 101 }
            y = 203
        }
        width = 100
        height = 20

        text = literal("Languages")
        onClicked = language()
    }
    button {
        position {
            x { it / 2 - 101 }
            y = 131
        }
        width = 204
        height = 20

        text = translatable("menu.singleplayer")
        onClicked = singleplayer()
    }
    button {
        position {
            x { it / 2 - 101 }
            y = 155
        }
        width = 204
        height = 20

        text = translatable("menu.multiplayer")
        onClicked = multiplayer()
    }
   /* button {
        position {
            x { it / 2 + 110 }
            y = 159
        }
        width = 100
        height = 20

        text = literal("Reload")
        onClicked = reloadCts()
    }
    */
    button {
        position {
            x { it / 2 + 3 }
            y = 227
        }
        width = 100
        height = 20

        text = translatable("menu.quit")
        onClicked = exit()
    }
    button {
        position {
            x { it / 2 - 101 }
            y = 227
        }
        width = 100
        height = 20

        text = translatable("menu.options")
        onClicked = options()
    }
}