#pragma once
#define _CRT_SECURE_NO_WARNINGS

#include <windows.h>
#include <math.h>
#include "detours.h"

#define WIN32_LEAN_AND_MEAN

#include "Core.h"
#include "CoreClasses.h"
#include "EngineClasses.h"

//=====================================================================================
// Font Loading:
//=====================================================================================

#define LoadFont(Font,Name) \
if (Font == NULL) \
{ \
	Font = (UFont*)UFont::StaticLoadObject(UFont::StaticClass(), NULL, TEXT(Name), NULL, LOAD_NoWarn, NULL); \
	if (Font != NULL) Font->SetFlags(RF_Keep); \
} \

//=====================================================================================
// Texture Loading:
//=====================================================================================

#define LoadTexture(Texture,Name) \
if (Texture == NULL) \
{ \
	Texture = (UTexture*)UTexture::StaticLoadObject(UTexture::StaticClass(), NULL, TEXT(Name), NULL, LOAD_NoWarn, NULL); \
	if (Texture != NULL) Texture->SetFlags(RF_Keep); \
} \

//=====================================================================================
// Color related defines:
//=====================================================================================

#define ColorBlack FColor(0,0,0,255)
#define ColorRed FColor(255,0,0,255)
#define ColorGreen FColor(0,255,0,255)
#define ColorBlue FColor(0,0,255,255)
#define ColorWhite FColor(255,255,255,255)
#define ColorYellow FColor(255,255,0,255)
#define ColorLightBlue FColor(0,255,255,255)
#define ColorPink FColor(255,0,255,255)
#define ColorGrey FColor(196,196,192,255)
#define ColorDarkGrey FColor(30,30,30,255)

//=========================================================================================
// Global Settings for external usage:
//=========================================================================================

namespace Global
{
	extern bool bHook;
	extern bool bHealthbars; 
	extern bool bFF; 
	extern bool bRadar;
	extern bool b2DRadar;
	extern int  iWallHack;

	extern float TickDeltaTime;

	extern int RadarPosX;
	extern int RadarPosY;
	extern int RadarWidth;
	extern int RadarHeight;
	extern int RadarDistance;

	extern FVector MyCameraLocation; 
	extern FRotator MyCameraRotation; 

	extern UFont* MySmallFont;
	extern UTexture* WhiteTex;
	extern APlayerController* PC;
}

//forward declarations
class cRadar;
class cHacks;

class Bot
{
public:
	Bot();
	~Bot();

	cRadar* MyRadar;
	cHacks* MyHacks;
	void Main (UCanvas* InCanvas);
	bool inline ValidTarget (APawn* Target);
	bool inline ValidRender (UCanvas* Canvas);
	FColor inline GetTeamColor (APawn * Target);
	void inline GetAxes (FRotator R, FVector &X, FVector &Y, FVector &Z);
	float inline Dot (const FVector& V1, const FVector& V2);
	bool inline IsEnemyz (APawn* Target);
	void Draw(UCanvas *Canvas, float PosX, float PosY, float Width, float Height, FColor Color);
	FVector WorldToScreen (UCanvas* Canvas, FVector WorldLocation);
	void DrawShadowedText(UCanvas* Canvas,FString Str,float PosX,float PosY,FColor Color);
	void GetCameraLocation (UCanvas* Canvas, FVector &InputLocation, FRotator &InputRotation);

};