#pragma once
#include "Mod.h"

class NetSkip : public Mod {
public:
	bool render = true;
	bool silent = false;
	float amount = 10.f;

	NetSkip() : Mod(_("Net Skip"), _("Make a lag."), Category::OTHER) {
		settings.push_back(new Setting{ _("Render"), &render, 0, 0, 0, {}, true });
		settings.push_back(new Setting{ _("Silent"), &silent, 0, 0, 0, {}, true });
		settings.push_back(new Setting{ _("Amount"), &amount, new float(10.f), new int(0.f), 2, {}, true, 5.f });

		enabled = false;
	}

private:
	std::vector<Packet*> packets;
	bool send = false;
	glm::vec3 lastpos;
	bool firstGet = false;

	virtual auto onRunUpdateCycle(bool* cancel) -> void override;
	virtual auto onRenderActorBefore(Actor* actor, glm::vec3* camera, glm::vec3* position) -> void override;
	virtual auto onWorldTick(Player* _this) -> void override;
	virtual auto onPacketSendAfter3(Packet* packet, bool* cancel) -> void override;
	virtual auto onDisabled() -> void override;
};
