#pragma once

#include "application/contracts/DisplayMetrics.h"
#include "application/contracts/IImGuiClient.h"
#include "presentation/MenuContext.h"
#include "presentation/MenuPorts.h"
#include "presentation/UiState.h"
#include "presentation/fonts/MenuFontAtlas.h"

namespace ta::presentation
{
    class MenuController final : public ta::application::IImGuiClient
    {
    public:
        MenuController(MenuPorts ports,
                       ta::application::DisplayMetrics display_metrics) noexcept;

        [[nodiscard]] bool is_active() const noexcept override;
        void setup(const ta::application::SystemFontPaths& system_fonts) override;
        void draw() override;
        [[nodiscard]] float scale_factor() const noexcept override;
        [[nodiscard]] bool needs_font_rebuild(float scale_factor) const noexcept override;
        void rebuild_fonts(float scale_factor) override;
        void reset_render_resources() noexcept override;

    private:
        MenuPorts ports_;
        ta::application::DisplayMetrics display_metrics_;
        ta::presentation::UiState state_;
        ta::application::SystemFontPaths system_fonts_;
    };
}
