// settings.hpp
#pragma once
#include <string>
inline ImFont* icon;

enum BoxType
{
    CORNER = 0,
    OUTLINE,
    FILLED
};
struct bone {
    int bone1;
    int bone2;

    bone(int b1, int b2) : bone1(b1), bone2(b2) {
    }
};

bone boneConnections[] = {
   bone(110, 67), // head to neck
   bone(67, 7), // neck to chest
   bone(7, 2), // chest to pelvis
   bone(7, 9), // chest to right shoulder
   bone(9, 35), // right shoulder to right elbow
   bone(35, 11), // right elbow to right wrist
   bone(7, 38), // chest to left shoulder
   bone(38, 39), // left shoulder to left elbow
   bone(39, 40), // left elbow to left wrist
   bone(2, 71), // pelvis to right hip
   bone(71, 72), // right hip to right knee
   bone(72, 73), // right knee to right shin
   bone(73, 75), // right shin to right ankle
   bone(2, 78), // pelvis to left hip
   bone(78, 79), // left hip to left knee
   bone(79, 80), // left knee to left shin
   bone(80, 82), // left shin to left ankle
};



namespace settings
{
    inline bool use_controller = false;
    struct Colors
    {
        ImColor visible = ImColor(255, 0, 255);       // Green
        ImColor notVisible = ImColor(255, 0, 0, 255);    // Red
    };
    struct ESP
    {
        bool box = true;
        bool snapline = false;
        bool distance = false;
        bool rank = false;
        bool username = false;
        bool platform = false;
        bool weaponesp = false;
        int espdis = 100;
        int textsize = 20;
        BoxType boxType = CORNER;
        bool boxOutlined = false;
        bool skeletonesp = false;
        ImColor icSkeletonColorVisible = ImColor(255, 0, 255);
        ImColor icSkeletonColorInvisible = ImColor(255, 0, 0);
    };
    struct World
    {
        bool WorldEsp = false;

        bool uncommon_loot = false;
        bool chickenESP = false;
        bool common_loot = false;
        bool llamas = false;
        bool rare_loot = false;
        bool SupplyDrop = false;
        bool epic_loot = false;
        bool legendary_loot = false;
        bool mythic_loot = false;
        bool exotic_loot = false;
        bool chests = false;
        bool ammo = false;  

        int render_distance = 350;
        bool loot_esp = true;
        bool show_distance = true;
        bool by_rarity = true;
        bool outline = true;
        bool text_background = false;
        int loot_distance = 350;

        int items_distance = 350;      
        int lootables_distance = 350;  

        // Snapline ESP
        bool snaplines = false;
        int snapline_position = 1; // 0 = Top, 1 = Center, 2 = Bottom

    };
    struct Exploits
    {
        bool bulletp = false;
        bool nospread = false;
        bool adsinair = false;
        bool cargravitymod = false;
        bool carfly = false;
        bool carspeedmod = false;
        int carflyvalue = 0;
        int carspeedvalue = 0;
        int cargravityamount = 0;
        int speedycuhspeed = 1;
        bool speedycuh = false;
    };
    struct Aimbot
    {
        bool enabled = true;
        int smoothsize = 75;
        int targetPriority = 0;
        int fovsize = 50;
        int Hitbox = 0;
        int aimkey = VK_RBUTTON;
        bool prediction = false;
        bool drawfov = true;
        bool vischeck = false;
        bool memoryaim = true;
        float fov = 100.0f;
    };
    struct UI
    {
        bool menu = false;
        bool vsync = false;
        bool streamproof = false;
    };
    inline Colors colors{};
    inline ESP esp{};
    inline Exploits exploits{};
    inline Aimbot aimbot{};
    inline World world{};
    inline UI ui{};
    inline void reset()
    {
        colors = Colors{};
        esp = ESP{};
        ui = UI{};
    }
    inline std::string to_string()
    {
        return "[Settings]\n"
            " Box: " + std::string(esp.box ? "On" : "Off") +
            " | Snapline: " + (esp.snapline ? "On" : "Off") +
            " | Distance: " + (esp.distance ? "On" : "Off") +
            " | VSync: " + (ui.vsync ? "On" : "Off") +
            " | Streamproof: " + (ui.streamproof ? "On" : "Off");
    }
}