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

import { showMainMenuForm } from './mainMenuForm';


export async function showHowToUseForm(player){
    let form = new ActionFormData();
    form.title("Colorful Glass - How To Use");

    let formBody = {rawtext: [
        {text: "\n§lIntroduction\n"},
        {text: "§r§7We have added 221 new textures to both the existing glass and glass panes so you can reimagine your base or give a village a new look!  Let's get started!\n\n"},
        {text: "§7--------------------§r\n\n"},
        {text: "§r§lSurvival Mode:\n"},
        {text: "§r§7If you are in Survival Mode you will need to craft some pieces of regular glass or glass panes in the color you wish to use.\n\nOnce you have done this, you will also need a Stone Cutter.  You can craft one or easily find one in a nearby village!\n\nJust put your newly crafted glass in the cutter and a lot of options will appear for for you!\n\n"},
        {text: "§7--------------------§r\n\n"},
        {text: "§r§lCreative Mode:\n"},
        {text: "§r§7If you are in Creative Mode just open your inventory and go to the 'Search' feature.  Just type 'Glass' into the search and everything will be right there for you!\n\n"},
        {text: "§7--------------------§r\n\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)
    }
}