#pragma once

#include <imgui.h>

#include "../settings_menu.hpp"

#include "cheats.hpp"
#include "menu/gather.hpp"
#include "menu/interact.hpp"
#include "menu/inventory.hpp"
#include "text.hpp"

#include "../../util/imgui/window_slide.hpp"

namespace game::state::play
{
  class Menu
  {
  public:
    menu::Interact interact;
    menu::Gather gather;
    Cheats cheats;
    menu::Inventory inventory;
    state::SettingsMenu settingsMenu;

#if DEBUG
    bool isCheats{true};
#else
    bool isCheats{};
#endif

    bool isOpen{true};
    bool isFullscreen{};
    static constexpr auto SLIDE_DURATION = 0.125f;
    static constexpr auto SLIDE_CLOSED = 0.0f;
    util::imgui::WindowSlide slide{};
    util::imgui::WindowSlide fullscreenSlide{SLIDE_DURATION, SLIDE_CLOSED};

    bool is_fullscreen_visible_get() const { return isOpen && (isFullscreen || fullscreenSlide.is_visible()); }
    float fullscreen_alpha_get() const { return fullscreenSlide.eased_get(); }
    void update(Resources&, ItemManager&, Entity&, Text&, Autofeed&);
  };
}
