import { giveGuidebook } from "./guidebook";
import { world } from "@minecraft/server";

world.afterEvents.playerSpawn.subscribe(({ player, initialSpawn }) => {
  if (initialSpawn) {
    giveGuidebook(player);
  }
});

export const BOOK_IDENTIFIER = "mythicus_tw:guidebook";

export const MAIN_FORM_CONFIG = {
  title: "mythicus_tw:ui.form.guidebook",
  body: [
    "mythicus_tw:ui.guidebook.1",
    "mythicus_tw:ui.guidebook.2",
    "mythicus_tw:ui.guidebook.3",
    "mythicus_tw:ui.guidebook.4",
  ],
  buttons: {
    watcher: "mythicus_tw:ui.guidebook.the_watcher",
    illusions: "mythicus_tw:ui.guidebook.illusions",
    structures: "mythicus_tw:ui.guidebook.structures",
    close: "mythicus_tw:ui.guidebook.close",
  },
};

export const WATCHER_INFO = {
  title: "mythicus_tw:ui.guidebook.the_watcher",
  description: "mythicus_tw:ui.watcher.description",
};

export const ILLUSIONS_INFO = {
  title: "mythicus_tw:ui.guidebook.illusions",
  description: "mythicus_tw:ui.illusions.description",
};

export const STRUCTURES_INFO = {
  title: "mythicus_tw:ui.guidebook.structures",
  description: "mythicus_tw:ui.structures.description",
};
