// 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 = true // 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 = 6000 // This sets the length a background would stay, 60 seconds
        backgroundFadeLength = 2000 // This sets the fade duration to another background, 2 seconds
        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()

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

        // You can create a text with "literal" or "translatable" if you want to translate with Resource Packs
        text = literal("SWEDON Fabric - 1.0.2")
        // The alignment here can be "left", "center" or "right", default is "left"
        align = "left"
        // Color of the text, default is 0xFFFFFF
        color = 0xFFFFFF
        // Whether the label has a shadow, default is false
        shadow = true
        // Mouse Hovered Color of the text, default is 0xFFFFFF
         hoveredColor = 0xFFFFFF
        // Mouse Click Function, default is nothing, here's a list of options
        onClicked = url("https://swedon.nu")
        /* onClicked = nothing()
        onClicked = modMenu()
        onClicked = language()
        onClicked = options()
        onClicked = exit()
        onClicked = accessibility()
        onClicked = singleplayer()
        onClicked = multiplayer()
        onClicked = realms()
        onClicked = reloadCts()*/
    }

    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 - 101 }
            y = 179
        }
        width = 204
        height = 20

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

    button {
        position {
            x { it / 2 - 101 }
            y = 203
        }
        width = 100
        height = 20

        text = literal("Reload")
        onClicked = reloadCts()
    }

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

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

        text = literal("Languages")
        onClicked = language()
    }

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

        text = translatable("menu.quit")
        onClicked = exit()
    }

    /*button {
        position {
            x = 5
            y = 5
        }
        width = 200
        height = 20

        // You can create a text with "literal" or "translatable" if you want to translate with Resource Packs
        text = literal("Random Button")
        // The alignment here can be "left", "center" or "right", default is "left"
        align = "left"
        // Mouse Click Function, default is nothing, look up see the list
        onClicked = nothing()
    }*/
}