#include "client/gui/BlitzGui.h"

#include "client/gui/GameChatGui.h"
#include "client/gui/MainMenu.h"
#include <imgui.h>

namespace blitz {
namespace gui {

BlitzGui::BlitzGui(Client* client) : GuiWidget(nullptr, client) {
	Enable();
	AddWidget(std::make_unique<MainMenu>(client));
	AddWidget(std::make_unique<GameChatGui>(this, client));
	SetCustomTheme();
}

void BlitzGui::Render() {
	GuiWidget::Render();
}

void BlitzGui::SetCustomTheme() {
	const static ImVec4 colorButton = {1.0f, 0.0f, 0.0f, 0.73f};
	const static ImVec4 colorButtonHover = {0.56f, 0.02f, 0.02f, 1.0f};
	const static ImVec4 colorButtonActive = {0.36f, 0.03f, 0.03f, 1.0f};
	const static ImVec4 colorCheckMark = {1.0f, 1.0f, 1.0f, 1.0f};

	ImGui::GetStyle().Colors[ImGuiCol_Button] = colorButton;
	ImGui::GetStyle().Colors[ImGuiCol_ButtonActive] = colorButtonActive;
	ImGui::GetStyle().Colors[ImGuiCol_ButtonHovered] = colorButtonHover;
	ImGui::GetStyle().Colors[ImGuiCol_CheckMark] = colorCheckMark;
	ImGui::GetStyle().Colors[ImGuiCol_FrameBg] = colorButton;
	ImGui::GetStyle().Colors[ImGuiCol_FrameBgActive] = colorButtonActive;
	ImGui::GetStyle().Colors[ImGuiCol_FrameBgHovered] = colorButtonHover;
}

}  // namespace gui
}  // namespace blitz
