import { ActionFormData } from '@minecraft/server-ui';
import { showHowToUseForm } from './howToUseForm';
import { showChangelogForm } from './changelogForm';
import { showSocialsForm } from './socialsForm';
import { showCreditForm } from './creditForm';

export async function showMainMenuForm(player){
    let form = new ActionFormData();
    form.title("Colorful Glass Add-On Guide Book");


    form.body(`\nHey ${player.name}! Thanks for checking out Colorful Glass Add-On by Block Perfect Studios. Press the buttons below to find out more!\n\n`);
    form.button("How To Use Colorful Glass", "textures/items/book_normal.png");
    form.button("Changelog", "textures/ui/debug_glyph_color.png");
    form.button("Socials / Contact Us", "textures/bps/cg/forms/bps_logo.png");
    form.button("Credit", "textures/ui/creative_icon.png");


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

    if(selection === 0){
        showHowToUseForm(player)
    } else if(selection === 1){
        showChangelogForm(player)
    } else if(selection === 2){
        showSocialsForm(player)
    } else if(selection === 3){
        showCreditForm(player)}
}
