#pragma once
#include "Mod.h"

#include "Datas/LanguageDatas.h"

class InventoryManager : public Mod {
public:
	float mindelay = 0.f, maxdelay = 0.5f;


	bool sword = true;
	bool pickaxe = true;
	bool axe = true;
	bool enderpearl = true;
	bool snowball = true;

	int swordslot = 0;
	int pickaxeslot = 1;
	int axeslot = 2;
	int enderpearlslot = 8;
	int snowballslot = 7;
	int bowslot = 6;
	int fireswordslot = 3;

	bool block = true;
	bool armor = true;
	bool spells = true;
	bool foods = true;
	bool bows = true;
	bool arrows = true;
	bool firesword = true;

	InventoryManager() : Mod(Datas::Language::get().module.player.inventorymanager.name, Datas::Language::get().module.player.inventorymanager.description, Category::PLAYER) {
		settings.push_back(new Setting{ _("Min Delay"), &mindelay, new float(1.f), new float(0.f), 2, {}, true });
		settings.push_back(new Setting{ _("Max Delay"), &maxdelay, new float(1.f), new float(0.f), 2, {}, true });
	
		settings.push_back(new Setting{ _("Allowed Item Settings"), 0, 0, 0, 3, {}, true });
		settings.push_back(new Setting{ _("Sword"), &sword, 0, 0, 0, {}, true });
		settings.push_back(new Setting{ _("Pickaxe"), &pickaxe, 0, 0, 0, {}, true });
		settings.push_back(new Setting{ _("Axe"), &axe, 0, 0, 0, {}, true });
		settings.push_back(new Setting{ _("Ender Pearl"), &enderpearl, 0, 0, 0, {}, true });
		settings.push_back(new Setting{ _("Snow Ball"), &snowball, 0, 0, 0, {}, true });
		settings.push_back(new Setting{ _("Block"), &block, 0, 0, 0, {}, true });
		settings.push_back(new Setting{ _("Armor"), &armor, 0, 0, 0, {}, true });
		settings.push_back(new Setting{ _("Spells"), &spells, 0, 0, 0, {}, true });
		settings.push_back(new Setting{ _("Foods"), &foods, 0, 0, 0, {}, true });
		settings.push_back(new Setting{ _("Bows"), &bows, 0, 0, 0, {}, true });
		settings.push_back(new Setting{ _("Arrows"), &arrows, 0, 0, 0, {}, true });
		settings.push_back(new Setting{ _("Fire Sword"), &firesword, 0, 0, 0, {}, true });

		settings.push_back(new Setting{ _("Slot Settings"), 0, 0, 0, 3, {}, true });
		settings.push_back(new Setting{ _("Sword Slot"), &swordslot, new int(8), 0, 1, {_("1"),_("2"),_("3"),_("4"),_("5"),_("6"),_("7"),_("8"),_("9")}, true});
		settings.push_back(new Setting{ _("Pickaxe Slot"), &pickaxeslot, new int(8), 0, 1, {_("1"),_("2"),_("3"),_("4"),_("5"),_("6"),_("7"),_("8"),_("9")}, true});
		settings.push_back(new Setting{ _("Axe Slot"), &axeslot, new int(8), 0, 1, {_("1"),_("2"),_("3"),_("4"),_("5"),_("6"),_("7"),_("8"),_("9")}, true});
		settings.push_back(new Setting{ _("Ender Pearl Slot"), &enderpearlslot, new int(8), 0, 1, {_("1"),_("2"),_("3"),_("4"),_("5"),_("6"),_("7"),_("8"),_("9")}, true });
		settings.push_back(new Setting{ _("Snow Ball Slot"), &snowballslot, new int(8), 0, 1, {_("1"),_("2"),_("3"),_("4"),_("5"),_("6"),_("7"),_("8"),_("9")}, true});
		settings.push_back(new Setting{ _("Bow Slot"), &bowslot, new int(8), 0, 1, {_("1"),_("2"),_("3"),_("4"),_("5"),_("6"),_("7"),_("8"),_("9")}, true });
		settings.push_back(new Setting{ _("Fire Sword Slot"), &fireswordslot, new int(8), 0, 1, {_("1"),_("2"),_("3"),_("4"),_("5"),_("6"),_("7"),_("8"),_("9")}, true});

		enabled = false;
	}
private:
	virtual auto onContainerScreenTick(ContainerScreenController* _this) -> void override;
	virtual auto onClient4() -> void override;
	virtual auto getMode() -> std::string;
};
