import * as utils from "../utils/index";
import { Settings } from "../shared/index";
utils.afterEvents.scriptEventRecieve.subscribe("ldz_250121:gravestone_drops", async (e) => {
    var _a;
    const player = (_a = e.sourceEntity) === null || _a === void 0 ? void 0 : _a.getPlayer();
    if (!player)
        return;
    new utils.MenuBuilder({
        type: "modal",
        title: "Gravestone Drops",
        contents: [
            {
                type: "dropdown",
                text: "Grave Drops",
                defaultValueIndex: () => {
                    switch (true) {
                        case Settings.MobGravestoneGuaranteed && Settings.MobGravestone:
                            return 1;
                        case Settings.MobGravestone && !Settings.MobGravestoneGuaranteed:
                            return 0;
                        case !Settings.MobGravestone:
                            return 2;
                        default:
                            return 0;
                    }
                },
                options: [
                    {
                        text: "Default",
                        onSelected: () => {
                            Settings.MobGravestoneGuaranteed = false;
                            Settings.MobGravestone = true;
                        }
                    },
                    {
                        text: "Guaranteed",
                        onSelected: () => {
                            Settings.MobGravestoneGuaranteed = true;
                            Settings.MobGravestone = true;
                        }
                    },
                    {
                        text: "Disabled",
                        onSelected: () => {
                            Settings.MobGravestoneGuaranteed = false;
                            Settings.MobGravestone = false;
                        }
                    }
                ]
            }
        ]
    }).showMenuToPlayer(player);
});
