#pragma once

#include "Mod.h"

class HitEffects : public Mod {
public:
	int mode = 0;

	float delay = 1.f;
	float removedelay = 1.f;
	float roundness = 24.f;
	float size = 10.f;
	float amount = 4.f;
	float speed = 2.f;

	HitEffects() : Mod(Datas::Language::get().module.render.hiteffects.name, Datas::Language::get().module.render.hiteffects.description, Category::RENDER) {
		settings.push_back(new Setting{ Datas::Language::get().module.render.hiteffects.mode, &mode, new int(1), new int(0), 1, {
			Datas::Language::get().module.render.hiteffects.mode_1,
			Datas::Language::get().module.render.hiteffects.mode_2
			}, true });
		settings.push_back(new Setting{ Datas::Language::get().module.render.hiteffects.delay, &delay, new float(2.f), new float(0.f), 2, {}, true });
		settings.push_back(new Setting{ Datas::Language::get().module.render.hiteffects.removedelay, &removedelay, new float(2.f), new float(0.f), 2, {}, true });
		settings.push_back(new Setting{ Datas::Language::get().module.render.hiteffects.roundness, &roundness, new float(30.f), new float(0.f), 2, {}, true, 5.f });
		settings.push_back(new Setting{ Datas::Language::get().module.render.hiteffects.size, &size, new float(20.f), new float(0.f), 2, {}, true, 5.f });
		settings.push_back(new Setting{ Datas::Language::get().module.render.hiteffects.amount, &amount, new float(10.f), new float(0.f), 2, {}, true, 5.f });
		settings.push_back(new Setting{ Datas::Language::get().module.render.hiteffects.speed, &speed, new float(10.f), new float(0.f), 2, {}, true, 5.f });

		enabled = false;
	}

private:
	struct RenderData {
		long long start;
		glm::vec3 pos, dipos;
		ImColor color;
		int falls;
		float dupe;
	};
	std::vector<RenderData> renderdatas;
	struct PlayerData {
		std::string name;
		glm::vec3 position;
	};
	std::vector<PlayerData> playerdatas;
	int perspective_ = 0;
	virtual auto onViewPerspectiveAfter(int* perspective) -> void override;
	virtual auto onClient() -> void override;
	virtual auto onAttack(Actor& actor) -> void override;
	virtual auto onImGuiRender() -> void override;
	virtual auto onDimensionChanged() -> void override;
};
