#pragma once

#include "Mod.h"

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

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

	KillEffects() : Mod(Datas::Language::get().module.render.killeffects.name, Datas::Language::get().module.render.killeffects.description, Category::RENDER) {
		settings.push_back(new Setting{ Datas::Language::get().module.render.killeffects.mode, &mode, new int(1), new int(0), 1, {
			Datas::Language::get().module.render.killeffects.mode_1,
			Datas::Language::get().module.render.killeffects.mode_2
			}, true });
		settings.push_back(new Setting{ Datas::Language::get().module.render.killeffects.removedelay, &removedelay, new float(2.f), new float(0.f), 2, {}, true });
		settings.push_back(new Setting{ Datas::Language::get().module.render.killeffects.roundness, &roundness, new float(30.f), new float(0.f), 2, {}, true, 5.f });
		settings.push_back(new Setting{ Datas::Language::get().module.render.killeffects.size, &size, new float(20.f), new float(0.f), 2, {}, true, 5.f });
		settings.push_back(new Setting{ Datas::Language::get().module.render.killeffects.amount, &amount, new float(10.f), new float(0.f), 2, {}, true, 5.f });
		settings.push_back(new Setting{ Datas::Language::get().module.render.killeffects.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;
	std::vector<Player*> list;

	int perspective_ = 0;
	virtual auto onViewPerspectiveAfter(int* perspective) -> void override;
	virtual auto onClient() -> void override;
	virtual auto onKilledPlayer(Actor& actor) -> void override;
	virtual auto onImGuiRender() -> void override;
	virtual auto onDimensionChanged() -> void override;
};
