import { ActionFormData } from '@minecraft/server-ui';

import { showMainMenuForm } from './mainMenuForm';


export async function showCreditForm(player){
    let form = new ActionFormData();
    form.title("Colorful Glass - Credits");

    let formBody = {rawtext: [
        {text: "\n§bColorful Glass Add-On was created by §lBlock Perfect Studios\n\n"},
        {text: "§7--------------------§r\n"},
        {text: "\n§7Block Artwork:\n"},
        {text: "§r§lSillyRabbit419\n\n"},
        {text: "§7--------------------§r\n"},
        {text: "\n§7Development:\n"},
        {text: "§r§lSauroops\n"},
        {text: "§r§lTomhmagic\n\n"},
        {text: "§7--------------------§r\n"},
        {text: "\n§7Key Art:\n"},
        {text: "§r§lHeyoPanda\n\n"},
        {text: "§7--------------------§r\n"}
    ] }

    form.body(formBody);
    form.button("Back", "textures/blocks/barrier");

    const result = await form.show(player)
    const selection = result.selection;

    if(selection === 0){
        showMainMenuForm(player)
    }
}