#pragma once
#include "Client.h"
#include "Utils/MemoryUtils.h"

namespace Hooks {
	class ScreenViews {
	private:
		typedef void(__thiscall* screenView_setupandrender_)(ScreenView* arg_1, MinecraftUIRenderContext* arg_2);
		inline static screenView_setupandrender_ screenview_setupandrender;

		static void callback_setupandrender(ScreenView* arg_1, MinecraftUIRenderContext* arg_2);

	public:
		inline static int state = -1;
		static void Init() {
			std::thread([&] {
				void* pattern_setupandrender = Utils::Memory::FindPattern(_("48 8B C4 48 89 58 18 55 56 57 41 54 41 55 41 56 41 57 48 8D A8 98 FD"));

				state = Utils::Memory::CreateHook(pattern_setupandrender, (void*)&callback_setupandrender, &screenview_setupandrender);

				if (state == 0)
					MessageBoxA(0, _("The program was terminated due to an error.\nError code: 1-1"), _("Valkyrie"), MB_ICONERROR);
				else
					std::cout << _("Test 1-1... OK\n");
				}).detach();
		}
	};
}
