#pragma once
#include "Mod.h"

#include "SDK/BedrockTextureData.h"

class Interface : public Mod {
public:
	int font = 0;
	int theme = 2;
	int language = 0;

	float red1 = 0.f, green1 = 0.f, blue1 = 0.f, red2 = 0.f, green2 = 0.f, blue2 = 0.f;
	int info = 1;

	bool fps = true, cps = true, bps = true;
	float blurs = 5.f;
	bool customdelta = false;
	float deltaTime = 0.1f;
	bool lowercase = false;
	bool bold = true;
	bool smoothinventory = false;
	bool smoothhotbar = true;
	int mainmenu = 1;

	bool renameaura = false;

	Interface() : Mod(_("Interface"), _("Draw basic renders."), Category::RENDER) {
		settings.push_back(new Setting{ _("Font"), &font, new int(2), new int(0), 1, {_("Product Sans"), _("Minecraft"), _("Proxima Nova")}, true });
		settings.push_back(new Setting{ _("Theme"), &theme, new int(9), new int(0), 1, {_("None"), _("Rainbow"), _("Default"), _("Cyan"), _("Plaxeon"), _("Orange"), _("Green"), _("Black"), _("Daysky"), _("Custom")}, true });
		settings.push_back(new Setting{ _("Language"), &language, new int(1), new int(0), 1, {_("English (Unites Statue)"), _("Spanish")}, true});

		settings.push_back(new Setting{ _("Custom Color Settings"), 0, 0, 0, 3, {}, true });
		settings.push_back(new Setting{ _("Red 1"), &red1, new float(1.f), new float(0.f), 2, {}, true });
		settings.push_back(new Setting{ _("Green 1"), &green1, new float(1.f), new float(0.f), 2, {}, true });
		settings.push_back(new Setting{ _("Blue 1"), &blue1, new float(1.f), new float(0.f), 2, {}, true });

		settings.push_back(new Setting{ _("Red 2"), &red2, new float(1.f), new float(0.f), 2, {}, true });
		settings.push_back(new Setting{ _("Green 2"), &green2, new float(1.f), new float(0.f), 2, {}, true });
		settings.push_back(new Setting{ _("Blue 2"), &blue2, new float(1.f), new float(0.f), 2, {}, true });

		settings.push_back(new Setting{ _("Info Settings"), 0, 0, 0, 3, {}, true });
		settings.push_back(new Setting{ _("Info"), &info, new int(2), 0, 1, {_("None"), _("Default"), _("Classic")}, true });

		settings.push_back(new Setting{ _("Fps"), &fps, 0, 0, 0, {}, true });
		settings.push_back(new Setting{ _("Cps"), &cps, 0, 0, 0, {}, true });
		settings.push_back(new Setting{ _("Bps"), &bps, 0, 0, 0, {}, true });
		settings.push_back(new Setting{ _("Blurs"), &blurs, new float(10.f), new float(0.f), 2, {}, true, 10.f });

		settings.push_back(new Setting{ _("Delta Settings"), 0, 0, 0, 3, {}, true });
		settings.push_back(new Setting{ _("Custom Delta"), &customdelta, 0, 0, 0, {}, true });
		settings.push_back(new Setting{ _("Delta Time"), &deltaTime, new float(1.f), new float(0.1f), 2, {}, true });

		settings.push_back(new Setting{ _("Text Settings"), 0, 0, 0, 3, {}, true });
		settings.push_back(new Setting{ _("Lower case"), &lowercase, 0, 0, 0, {}, true });
		settings.push_back(new Setting{ _("Bold"), &bold, 0, 0, 0, {}, true });
		settings.push_back(new Setting{ _("Smooth Inventory"), &smoothinventory, 0, 0, 0, {}, true });
		settings.push_back(new Setting{ _("Smooth Hotbar"), &smoothhotbar, 0, 0, 0, {}, true });
		settings.push_back(new Setting{ _("Main Menu"), &mainmenu, new int(2), new int(0), 1, {_("None"), _("Rise"), _("ONG")}, true});

		settings.push_back(new Setting{ _("Name Settings"), 0, 0, 0, 3, {}, true });
		settings.push_back(new Setting{ _("Rename Aura"), &renameaura, 0, 0, 0, {}, true });
		
		enabled = true;
		visible = false;
	}
	ImVec2 fpspos, cpspos, bpspos;
	std::deque<long long> clicks;
	ImVec2 playPos = ImVec2();
private:
	BedrockTextureData* selectedHotbarPtr = nullptr;
	struct OrganicShape {
		ImVec2 center;
		ImVec2 velocity;
		float base_radius;
		ImColor color;
		float noise_seed;
	};
	std::vector<OrganicShape> shapes;

	virtual auto onUIControlGetPosition(UIControl* _this, glm::vec2* position) -> void override;
	virtual auto onGetTexture(ResourceLocation* location, mce::TexturePtr* ptr) -> void override;
	virtual auto onDrawImage(BedrockTextureData* data, glm::vec2* pos) -> void override;
	virtual auto onSwing(Player* _this, bool* cancel) -> void override;
	virtual auto onImGuiRender() -> void override;
	virtual auto onClient() -> void override;
	virtual auto getMode() -> std::string override;
};
