bool CKey::IsAnalogButton() const { if ((GetButtonCode() > 261 && GetButtonCode() < 270) || (GetButtonCode() > 279 && GetButtonCode() < 284)) return true; return false; }
bool CKey::IsIRRemote() const { if (GetButtonCode() < 256) return true; return false; }
void Settings::LoadConfig(std::string path) { if (!std::ifstream(path).good()) { Settings::LoadDefaultsOrSave(path); return; } Json::Value settings; std::ifstream config_doc(path, std::ifstream::binary); config_doc >> settings; GetVal(settings["UI"]["mainColor"], &Settings::UI::mainColor); GetVal(settings["UI"]["bodyColor"], &Settings::UI::bodyColor); GetVal(settings["UI"]["fontColor"], &Settings::UI::fontColor); GetVal(settings["UI"]["Fonts"]["ESP"]["family"], &Settings::UI::Fonts::ESP::family); GetVal(settings["UI"]["Fonts"]["ESP"]["size"], &Settings::UI::Fonts::ESP::size); GetVal(settings["UI"]["Fonts"]["ESP"]["flags"], &Settings::UI::Fonts::ESP::flags); Fonts::SetupFonts(); Settings::Aimbot::weapons.clear(); for (Json::ValueIterator itr = settings["Aimbot"]["weapons"].begin(); itr != settings["Aimbot"]["weapons"].end(); itr++) { std::string weaponDataKey = itr.key().asString(); auto weaponSetting = settings["Aimbot"]["weapons"][weaponDataKey]; // XXX Using exception handling to deal with this is stupid, but I don't care to find a better solution // XXX We can't use GetOrdinal() since the key type is a string... int weaponID; try { weaponID = std::stoi(weaponDataKey); } catch (std::invalid_argument) // Not a number { weaponID = Util::Items::GetItemIndex(weaponDataKey); } Settings::Aimbot::Weapon weapon; bool autoWallBones[] = { true, false, false, false, false, false }; for (int bone = HITBOX_HEAD; bone <= HITBOX_ARMS; bone++) autoWallBones[bone] = weaponSetting["AutoWall"]["Bones"][bone].asBool(); weapon = Settings::Aimbot::Weapon( weaponSetting["Enabled"].asBool(), weaponSetting["Silent"].asBool(), weaponSetting["Friendly"].asBool(), weaponSetting["TargetBone"].asInt(), Util::GetButtonCode(weaponSetting["AimKey"].asCString()), weaponSetting["AimKeyOnly"].asBool(), weaponSetting["Smooth"]["Enabled"].asBool(), weaponSetting["Smooth"]["Amount"].asFloat(), weaponSetting["Smooth"]["Type"].asInt(), weaponSetting["Smooth"]["Salting"]["Enabled"].asBool(), weaponSetting["Smooth"]["Salting"]["Multiplier"].asFloat(), weaponSetting["ErrorMargin"]["Enabled"].asBool(), weaponSetting["ErrorMargin"]["Value"].asFloat(), weaponSetting["AutoAim"]["Enabled"].asBool(), weaponSetting["AutoAim"]["FOV"].asFloat(), weaponSetting["AimStep"]["Enabled"].asBool(), weaponSetting["AimStep"]["Amount"].asFloat(), weaponSetting["RCS"]["Enabled"].asBool(), weaponSetting["RCS"]["AlwaysOn"].asBool(), weaponSetting["RCS"]["Amount"].asFloat(), weaponSetting["AutoPistol"]["Enabled"].asBool(), weaponSetting["AutoShoot"]["Enabled"].asBool(), weaponSetting["AutoScope"]["Enabled"].asBool(), weaponSetting["NoShoot"]["Enabled"].asBool(), weaponSetting["IgnoreJump"]["Enabled"].asBool(), weaponSetting["SmokeCheck"]["Enabled"].asBool(), weaponSetting["AutoWall"]["Enabled"].asBool(), weaponSetting["AutoWall"]["Value"].asFloat(), autoWallBones ); Settings::Aimbot::weapons[weaponID] = weapon; } GetVal(settings["Resolver"]["resolve_all"], &Settings::Resolver::resolve_all); GetVal(settings["Triggerbot"]["enabled"], &Settings::Triggerbot::enabled); GetButtonCode(settings["Triggerbot"]["key"], &Settings::Triggerbot::key); GetVal(settings["Triggerbot"]["Filters"]["enemies"], &Settings::Triggerbot::Filters::enemies); GetVal(settings["Triggerbot"]["Filters"]["allies"], &Settings::Triggerbot::Filters::allies); GetVal(settings["Triggerbot"]["Filters"]["walls"], &Settings::Triggerbot::Filters::walls); GetVal(settings["Triggerbot"]["Filters"]["smoke_check"], &Settings::Triggerbot::Filters::smoke_check); GetVal(settings["Triggerbot"]["Filters"]["head"], &Settings::Triggerbot::Filters::head); GetVal(settings["Triggerbot"]["Filters"]["chest"], &Settings::Triggerbot::Filters::chest); GetVal(settings["Triggerbot"]["Filters"]["stomach"], &Settings::Triggerbot::Filters::stomach); GetVal(settings["Triggerbot"]["Filters"]["arms"], &Settings::Triggerbot::Filters::arms); GetVal(settings["Triggerbot"]["Filters"]["legs"], &Settings::Triggerbot::Filters::legs); GetVal(settings["Triggerbot"]["Delay"]["enabled"], &Settings::Triggerbot::Delay::enabled); GetVal(settings["Triggerbot"]["Delay"]["value"], &Settings::Triggerbot::Delay::value); GetVal(settings["AntiAim"]["Yaw"]["enabled"], &Settings::AntiAim::Yaw::enabled); GetVal(settings["AntiAim"]["Yaw"]["type"], &Settings::AntiAim::Yaw::type); GetVal(settings["AntiAim"]["Yaw"]["type_fake"], &Settings::AntiAim::Yaw::type_fake); GetVal(settings["AntiAim"]["Pitch"]["enabled"], &Settings::AntiAim::Pitch::enabled); GetVal(settings["AntiAim"]["Pitch"]["type"], &Settings::AntiAim::Pitch::type); GetVal(settings["AntiAim"]["HeadEdge"]["enabled"], &Settings::AntiAim::HeadEdge::enabled); GetVal(settings["AntiAim"]["HeadEdge"]["distance"], &Settings::AntiAim::HeadEdge::distance); GetVal(settings["AntiAim"]["AutoDisable"]["knife_held"], &Settings::AntiAim::AutoDisable::knife_held); GetVal(settings["AntiAim"]["AutoDisable"]["no_enemy"], &Settings::AntiAim::AutoDisable::no_enemy); GetVal(settings["ESP"]["enabled"], &Settings::ESP::enabled); GetVal(settings["ESP"]["enemy_color"], &Settings::ESP::enemy_color); GetVal(settings["ESP"]["enemy_visible_color"], &Settings::ESP::enemy_visible_color); GetVal(settings["ESP"]["ally_color"], &Settings::ESP::ally_color); GetVal(settings["ESP"]["ally_visible_color"], &Settings::ESP::ally_visible_color); GetVal(settings["ESP"]["t_color"], &Settings::ESP::t_color); GetVal(settings["ESP"]["t_visible_color"], &Settings::ESP::t_visible_color); GetVal(settings["ESP"]["ct_color"], &Settings::ESP::ct_color); GetVal(settings["ESP"]["ct_visible_color"], &Settings::ESP::ct_visible_color); GetVal(settings["ESP"]["bomb_color"], &Settings::ESP::bomb_color); GetVal(settings["ESP"]["bomb_defusing_color"], &Settings::ESP::bomb_defusing_color); GetVal(settings["ESP"]["hostage_color"], &Settings::ESP::hostage_color); GetVal(settings["ESP"]["defuser_color"], &Settings::ESP::defuser_color); GetVal(settings["ESP"]["weapon_color"], &Settings::ESP::weapon_color); GetVal(settings["ESP"]["chicken_color"], &Settings::ESP::chicken_color); GetVal(settings["ESP"]["fish_color"], &Settings::ESP::fish_color); GetVal(settings["ESP"]["smoke_color"], &Settings::ESP::smoke_color); GetVal(settings["ESP"]["decoy_color"], &Settings::ESP::decoy_color); GetVal(settings["ESP"]["flashbang_color"], &Settings::ESP::flashbang_color); GetVal(settings["ESP"]["grenade_color"], &Settings::ESP::grenade_color); GetVal(settings["ESP"]["molotov_color"], &Settings::ESP::molotov_color); GetVal(settings["ESP"]["Glow"]["enabled"], &Settings::ESP::Glow::enabled); GetVal(settings["ESP"]["Glow"]["ally_color"], &Settings::ESP::Glow::ally_color); GetVal(settings["ESP"]["Glow"]["enemy_color"], &Settings::ESP::Glow::enemy_color); GetVal(settings["ESP"]["Glow"]["enemy_visible_color"], &Settings::ESP::Glow::enemy_visible_color); GetVal(settings["ESP"]["Glow"]["weapon_color"], &Settings::ESP::Glow::weapon_color); GetVal(settings["ESP"]["Glow"]["grenade_color"], &Settings::ESP::Glow::grenade_color); GetVal(settings["ESP"]["Glow"]["defuser_color"], &Settings::ESP::Glow::defuser_color); GetVal(settings["ESP"]["Glow"]["chicken_color"], &Settings::ESP::Glow::chicken_color); GetVal(settings["ESP"]["Filters"]["legit"], &Settings::ESP::Filters::legit); GetVal(settings["ESP"]["Filters"]["visibility_check"], &Settings::ESP::Filters::visibility_check); GetVal(settings["ESP"]["Filters"]["smoke_check"], &Settings::ESP::Filters::smoke_check); GetVal(settings["ESP"]["Filters"]["enemies"], &Settings::ESP::Filters::enemies); GetVal(settings["ESP"]["Filters"]["allies"], &Settings::ESP::Filters::allies); GetVal(settings["ESP"]["Filters"]["bomb"], &Settings::ESP::Filters::bomb); GetVal(settings["ESP"]["Filters"]["hostages"], &Settings::ESP::Filters::hostages); GetVal(settings["ESP"]["Filters"]["defusers"], &Settings::ESP::Filters::defusers); GetVal(settings["ESP"]["Filters"]["weapons"], &Settings::ESP::Filters::weapons); GetVal(settings["ESP"]["Filters"]["chickens"], &Settings::ESP::Filters::chickens); GetVal(settings["ESP"]["Filters"]["fishes"], &Settings::ESP::Filters::fishes); GetVal(settings["ESP"]["Filters"]["throwables"], &Settings::ESP::Filters::throwables); GetVal(settings["ESP"]["Info"]["name"], &Settings::ESP::Info::name); GetVal(settings["ESP"]["Info"]["clan"], &Settings::ESP::Info::clan); GetVal(settings["ESP"]["Info"]["steam_id"], &Settings::ESP::Info::steam_id); GetVal(settings["ESP"]["Info"]["rank"], &Settings::ESP::Info::rank); GetVal(settings["ESP"]["Info"]["health"], &Settings::ESP::Info::health); GetVal(settings["ESP"]["Info"]["weapon"], &Settings::ESP::Info::weapon); GetVal(settings["ESP"]["Info"]["scoped"], &Settings::ESP::Info::scoped); GetVal(settings["ESP"]["Info"]["reloading"], &Settings::ESP::Info::reloading); GetVal(settings["ESP"]["Info"]["flashed"], &Settings::ESP::Info::flashed); GetVal(settings["ESP"]["Info"]["planting"], &Settings::ESP::Info::planting); GetVal(settings["ESP"]["Info"]["has_defuser"], &Settings::ESP::Info::has_defuser); GetVal(settings["ESP"]["Info"]["defusing"], &Settings::ESP::Info::defusing); GetVal(settings["ESP"]["Info"]["grabbing_hostage"], &Settings::ESP::Info::grabbing_hostage); GetVal(settings["ESP"]["Info"]["rescuing"], &Settings::ESP::Info::rescuing); GetVal(settings["ESP"]["Info"]["location"], &Settings::ESP::Info::location); GetVal(settings["ESP"]["Boxes"]["enabled"], &Settings::ESP::Boxes::enabled); GetVal(settings["ESP"]["Boxes"]["type"], &Settings::ESP::Boxes::type); GetVal(settings["ESP"]["Skeleton"]["enabled"], &Settings::ESP::Skeleton::enabled); GetVal(settings["ESP"]["Skeleton"]["color"], &Settings::ESP::Skeleton::color); GetVal(settings["ESP"]["Bars"]["enabled"], &Settings::ESP::Bars::enabled); GetVal(settings["ESP"]["Bars"]["color_type"], &Settings::ESP::Bars::color_type); GetVal(settings["ESP"]["Bars"]["type"], &Settings::ESP::Bars::type); GetVal(settings["ESP"]["Tracers"]["enabled"], &Settings::ESP::Tracers::enabled); GetVal(settings["ESP"]["Tracers"]["type"], &Settings::ESP::Tracers::type); GetVal(settings["ESP"]["BulletTracers"]["enabled"], &Settings::ESP::BulletTracers::enabled); GetVal(settings["ESP"]["FOVCrosshair"]["enabled"], &Settings::ESP::FOVCrosshair::enabled); GetVal(settings["ESP"]["FOVCrosshair"]["color"], &Settings::ESP::FOVCrosshair::color); GetVal(settings["ESP"]["Chams"]["Arms"]["enabled"], &Settings::ESP::Chams::Arms::enabled); GetVal(settings["ESP"]["Chams"]["Arms"]["type"], &Settings::ESP::Chams::Arms::type); GetVal(settings["ESP"]["Chams"]["Arms"]["color"], &Settings::ESP::Chams::Arms::color); GetVal(settings["ESP"]["Chams"]["players_ally_color"], &Settings::ESP::Chams::ally_color); GetVal(settings["ESP"]["Chams"]["players_ally_visible_color"], &Settings::ESP::Chams::ally_visible_color); GetVal(settings["ESP"]["Chams"]["players_enemy_color"], &Settings::ESP::Chams::enemy_color); GetVal(settings["ESP"]["Chams"]["players_enemy_visible_color"], &Settings::ESP::Chams::enemy_visible_color); GetVal(settings["ESP"]["Chams"]["type"], &Settings::ESP::Chams::type); GetVal(settings["ESP"]["Chams"]["enabled"], &Settings::ESP::Chams::enabled); GetVal(settings["ESP"]["Sounds"]["enabled"], &Settings::ESP::Sounds::enabled); GetVal(settings["ESP"]["Sounds"]["time"], &Settings::ESP::Sounds::time); GetVal(settings["ESP"]["Hitmarker"]["enabled"], &Settings::ESP::Hitmarker::enabled); GetVal(settings["ESP"]["Hitmarker"]["enemies"], &Settings::ESP::Hitmarker::enemies); GetVal(settings["ESP"]["Hitmarker"]["allies"], &Settings::ESP::Hitmarker::allies); GetVal(settings["ESP"]["Hitmarker"]["color"], &Settings::ESP::Hitmarker::color); GetVal(settings["ESP"]["Hitmarker"]["duration"], &Settings::ESP::Hitmarker::duration); GetVal(settings["ESP"]["Hitmarker"]["size"], &Settings::ESP::Hitmarker::size); GetVal(settings["ESP"]["Hitmarker"]["inner_gap"], &Settings::ESP::Hitmarker::inner_gap); GetVal(settings["Dlights"]["enabled"], &Settings::Dlights::enabled); GetVal(settings["Dlights"]["radius"], &Settings::Dlights::radius); GetVal(settings["Spammer"]["spammer_type"], &Settings::Spammer::type); GetVal(settings["Spammer"]["say_team"], &Settings::Spammer::say_team); GetVal(settings["Spammer"]["KillSpammer"]["enabled"], &Settings::Spammer::KillSpammer::enabled); GetVal(settings["Spammer"]["KillSpammer"]["say_team"], &Settings::Spammer::KillSpammer::say_team); GetVal(settings["Spammer"]["KillSpammer"]["message"], &Settings::Spammer::KillSpammer::message); if (!settings["Spammer"]["NormalSpammer"]["messages"].isNull()) { Settings::Spammer::NormalSpammer::messages.clear(); for (const Json::Value& message : settings["Spammer"]["NormalSpammer"]["messages"]) Settings::Spammer::NormalSpammer::messages.push_back(message.asString()); } GetVal(settings["Spammer"]["PositionSpammer"]["show_name"], &Settings::Spammer::PositionSpammer::show_name); GetVal(settings["Spammer"]["PositionSpammer"]["show_weapon"], &Settings::Spammer::PositionSpammer::show_weapon); GetVal(settings["Spammer"]["PositionSpammer"]["show_rank"], &Settings::Spammer::PositionSpammer::show_rank); GetVal(settings["Spammer"]["PositionSpammer"]["show_wins"], &Settings::Spammer::PositionSpammer::show_wins); GetVal(settings["Spammer"]["PositionSpammer"]["show_health"], &Settings::Spammer::PositionSpammer::show_health); GetVal(settings["Spammer"]["PositionSpammer"]["show_money"], &Settings::Spammer::PositionSpammer::show_money); GetVal(settings["Spammer"]["PositionSpammer"]["show_lastplace"], &Settings::Spammer::PositionSpammer::show_lastplace); GetVal(settings["BHop"]["enabled"], &Settings::BHop::enabled); GetVal(settings["AutoStrafe"]["enabled"], &Settings::AutoStrafe::enabled); GetVal(settings["AutoStrafe"]["type"], &Settings::AutoStrafe::type); GetVal(settings["Noflash"]["enabled"], &Settings::Noflash::enabled); GetVal(settings["Noflash"]["value"], &Settings::Noflash::value); GetVal(settings["Radar"]["enabled"], &Settings::Radar::enabled); GetVal(settings["Radar"]["zoom"], &Settings::Radar::zoom); GetVal(settings["Radar"]["enemies"], &Settings::Radar::enemies); GetVal(settings["Radar"]["allies"], &Settings::Radar::allies); GetVal(settings["Radar"]["legit"], &Settings::Radar::legit); GetVal(settings["Radar"]["visibility_check"], &Settings::Radar::visibility_check); GetVal(settings["Radar"]["smoke_check"], &Settings::Radar::smoke_check); GetVal(settings["Radar"]["InGame"]["enabled"], &Settings::Radar::InGame::enabled); LoadUIColor(settings["Radar"]["enemy_color"], Settings::Radar::enemy_color); LoadUIColor(settings["Radar"]["enemy_visible_color"], Settings::Radar::enemy_visible_color); LoadUIColor(settings["Radar"]["ally_color"], Settings::Radar::ally_color); LoadUIColor(settings["Radar"]["ally_visible_color"], Settings::Radar::ally_visible_color); LoadUIColor(settings["Radar"]["t_color"], Settings::Radar::t_color); LoadUIColor(settings["Radar"]["t_visible_color"], Settings::Radar::t_visible_color); LoadUIColor(settings["Radar"]["ct_color"], Settings::Radar::ct_color); LoadUIColor(settings["Radar"]["ct_visible_color"], Settings::Radar::ct_visible_color); LoadUIColor(settings["Radar"]["bomb_color"], Settings::Radar::bomb_color); LoadUIColor(settings["Radar"]["bomb_defusing_color"], Settings::Radar::bomb_defusing_color); GetVal(settings["Radar"]["icons_scale"], &Settings::Radar::icons_scale); GetVal(settings["Recoilcrosshair"]["enabled"], &Settings::Recoilcrosshair::enabled); GetVal(settings["Recoilcrosshair"]["showOnlyWhenShooting"], &Settings::Recoilcrosshair::showOnlyWhenShooting); GetVal(settings["FOVChanger"]["enabled"], &Settings::FOVChanger::enabled); GetVal(settings["FOVChanger"]["value"], &Settings::FOVChanger::value); GetVal(settings["FOVChanger"]["viewmodel_enabled"], &Settings::FOVChanger::viewmodel_enabled); GetVal(settings["FOVChanger"]["viewmodel_value"], &Settings::FOVChanger::viewmodel_value); GetVal(settings["FOVChanger"]["ignore_scope"], &Settings::FOVChanger::ignore_scope); GetVal(settings["Airstuck"]["enabled"], &Settings::Airstuck::enabled); GetButtonCode(settings["Airstuck"]["key"], &Settings::Airstuck::key); Settings::Skinchanger::enabled = false; Settings::Skinchanger::skins.clear(); for (Json::ValueIterator itr = settings["Skinchanger"]["skins"].begin(); itr != settings["Skinchanger"]["skins"].end(); itr++) { std::string skinDataKey = itr.key().asString(); auto skinSetting = settings["Skinchanger"]["skins"][skinDataKey]; // XXX Using exception handling to deal with this is stupid, but I don't care to find a better solution // XXX We can't use GetOrdinal() since the key type is a string... int weaponID; try { weaponID = std::stoi(skinDataKey); } catch (std::invalid_argument) // Not a number { weaponID = Util::Items::GetItemIndex(skinDataKey); } enum ItemDefinitionIndex defIndex; GetOrdinal<enum ItemDefinitionIndex, Util::Items::GetItemIndex>(skinSetting["ItemDefinitionIndex"], &defIndex); Settings::Skinchanger::Skin skin = Settings::Skinchanger::Skin( skinSetting["PaintKit"].asInt(), defIndex, skinSetting["Seed"].asInt(), skinSetting["Wear"].asFloat(), skinSetting["StatTrak"].asInt(), skinSetting["CustomName"].asString(), skinSetting["Model"].asString() ); Settings::Skinchanger::skins[weaponID] = skin; } SkinChanger::ForceFullUpdate = true; GetVal(settings["Skinchanger"]["enabled"], &Settings::Skinchanger::enabled); GetVal(settings["ShowRanks"]["enabled"], &Settings::ShowRanks::enabled); GetVal(settings["ShowSpectators"]["enabled"], &Settings::ShowSpectators::enabled); GetVal(settings["ClanTagChanger"]["value"], &Settings::ClanTagChanger::value); GetVal(settings["ClanTagChanger"]["enabled"], &Settings::ClanTagChanger::enabled); GetVal(settings["ClanTagChanger"]["animation"], &Settings::ClanTagChanger::animation); GetVal(settings["ClanTagChanger"]["animation_speed"], &Settings::ClanTagChanger::animation_speed); GetVal(settings["ClanTagChanger"]["type"], &Settings::ClanTagChanger::type); ::ClanTagChanger::UpdateClanTagCallback(); GetVal(settings["View"]["NoViewPunch"]["enabled"], &Settings::View::NoViewPunch::enabled); GetVal(settings["View"]["NoAimPunch"]["enabled"], &Settings::View::NoAimPunch::enabled); GetVal(settings["Teleport"]["enabled"], &Settings::Teleport::enabled); GetButtonCode(settings["Teleport"]["key"], &Settings::Teleport::key); GetVal(settings["FakeLag"]["enabled"], &Settings::FakeLag::enabled); GetVal(settings["AutoAccept"]["enabled"], &Settings::AutoAccept::enabled); GetVal(settings["NoSky"]["enabled"], &Settings::NoSky::enabled); GetVal(settings["NoSky"]["color"], &Settings::NoSky::color); GetVal(settings["ASUSWalls"]["enabled"], &Settings::ASUSWalls::enabled); GetVal(settings["ASUSWalls"]["color"], &Settings::ASUSWalls::color); GetVal(settings["NoScopeBorder"]["enabled"], &Settings::NoScopeBorder::enabled); GetVal(settings["Autoblock"]["enabled"], &Settings::Autoblock::enabled); GetButtonCode(settings["Autoblock"]["key"], &Settings::Autoblock::key); GetVal(settings["AutoDefuse"]["enabled"], &Settings::AutoDefuse::enabled); GetVal(settings["NoSmoke"]["enabled"], &Settings::NoSmoke::enabled); GetVal(settings["ScreenshotCleaner"]["enabled"], &Settings::ScreenshotCleaner::enabled); }