Тьомчик
-
Автор темы
- #1
Хайп Хайп Хайп я это делал для себя кому не нравится тот гей
Удачно впастить ваш мегахук хвх 2024 убийство неверлуз
Удачно впастить ваш мегахук хвх 2024 убийство неверлуз
enemy (visible, invisible, visible attachments, invisible attachments)
backtrack (all tick, last tick, invisible)
local (model, weapons, arms, sleeves)
team (visible, invisible)
ragdoll (ну я пытался, мне стало лень обновлять классы и я забил).
old shaders (feat lobotomy)
backtrack (all tick, last tick, invisible)
local (model, weapons, arms, sleeves)
team (visible, invisible)
ragdoll (ну я пытался, мне стало лень обновлять классы и я забил).
old shaders (feat lobotomy)
ну типа дрочи ножками
C++:
static const char* materials[10] = { "textured", "flat", "metalic", "plastic", "elixir", "glow", "wireframe", "crystal", "space", "glass" };
C++:
namespace features::chams {
void old_shaders();
void initialize();
void render(i_mat_render_context* ctx, const draw_model_state_t& state, const model_render_info_t& info, matrix_t* matrix);
void entities(i_mat_render_context* ctx, const draw_model_state_t& state, const model_render_info_t& info, matrix_t* matrix);
void attachments(i_mat_render_context* ctx, const draw_model_state_t& state, const model_render_info_t& info, matrix_t* matrix);
void arms(i_mat_render_context* ctx, const draw_model_state_t& state, const model_render_info_t& info, matrix_t* matrix);
void weapons(i_mat_render_context* ctx, const draw_model_state_t& state, const model_render_info_t& info, matrix_t* matrix);
void sleeves(i_mat_render_context* ctx, const draw_model_state_t& state, const model_render_info_t& info, matrix_t* matrix);
}
C++:
#include "../visuals/visuals.hpp"
#include "../../menu/config/config.hpp"
#include "../../menu/menu.hpp"
#include "../../sdk/math/math.hpp"
#include "../../features/aimbot/aimbot.hpp"
#include "../../hooks/hooks.hpp"
i_material* materials[9];
i_material* create_material(std::string name, std::string type, std::string material) {
auto kv = static_cast<c_key_values*>(malloc(36));
kv->init(type.c_str());
kv->load_from_buffer(name.c_str(), material.c_str());
return interfaces::material_system->create_material(name.c_str(), kv);
}
void override_material(bool ignorez, int type, color_t color) {
i_material* material = nullptr;
switch (type) {
case 0: material = materials[0]; break;
case 1: material = materials[1]; break;
case 2: material = materials[2]; break;
case 3: material = materials[3]; break;
case 4: material = materials[4]; break;
case 5: material = materials[5]; break;
case 6: material = materials[0]; break;
case 7: material = materials[6]; break;
case 8: material = materials[7]; break;
case 9: material = materials[8]; break;
}
material->set_material_var_flag(material_var_ignorez, ignorez);
material->set_material_var_flag(material_var_wireframe, type == 6);
auto overlay = material->find_var("$envmaptint", nullptr);
overlay->set_vec_value(color.r(), color.g(), color.b());
material->color_modulate(color.r(), color.g(), color.b());
material->alpha_modulate(color.a());
interfaces::model_render->override_material(material);
}
void features::chams::initialize() {
materials[0] = interfaces::material_system->find_material("debug/debugambientcube", TEXTURE_GROUP_MODEL);
materials[0]->increment_reference_count();
materials[1] = interfaces::material_system->find_material("debug/debugdrawflat", TEXTURE_GROUP_MODEL);
materials[1]->increment_reference_count();
materials[2] = interfaces::material_system->find_material("models/inventory_items/trophy_majors/gloss", TEXTURE_GROUP_MODEL);
materials[2]->increment_reference_count();
materials[3] = interfaces::material_system->find_material("dev/glow_armsrace", TEXTURE_GROUP_MODEL);
materials[3]->increment_reference_count();
materials[4] = interfaces::material_system->find_material("models/inventory_items/cologne_prediction/cologne_prediction_glass", TEXTURE_GROUP_MODEL);
materials[4]->increment_reference_count();
materials[5] = create_material("metallic", "VertexLitGeneric", R"#("VertexLitGeneric" {
"$basetexture" "vgui/white_additive"
"$ignorez" "0"
"$envmap" "env_cubemap"
"$normalmapalphaenvmapmask" "1"
"$envmapcontrast" "1"
"$nofog" "1"
"$model" "1"
"$nocull" "0"
"$selfillum" "1"
"$halflambert" "1"
"$znearer" "0"
"$flat" "1"
}
)#");
materials[6] = create_material("elixir", "VertexLitGeneric", R"#("VertexLitGeneric" {
"$basetexture" "VGUI/white_additive"
"$bumpmap" "de_nuke/hr_nuke/pool_water_normals_002"
"$bumptransform" "center 0.5 0.5 scale 0.25 0.25 rotate 0.0 translate 0.0 0.0"
"$ignorez" "0"
"$nofog" "1"
"$model" "1"
"$color2" "[1.0, 1.0, 1.0]"
"$halflambert" "1"
"$envmap" "env_cubemap"
"$envmaptint" "[0.1 0.1 0.1]"
"$envmapfresnel" "1.0"
"$envmapfresnelminmaxexp" "[1.0, 1.0, 1.0]"
"$phong" "1"
"$phongexponent" "1024"
"$phongboost" "4.0"
"$phongfresnelranges" "[1.0, 1.0, 1.0]"
"$rimlight" "1"
"$rimlightexponent" "4.0"
"$rimlightboost" "2.0"
"Proxies"
{
"TextureScroll"
{
"textureScrollVar" "$bumptransform"
"textureScrollRate" "0.25"
"textureScrollAngle" "0.0"
}
}
} )#");
materials[7] = create_material("crystal", "VertexLitGeneric", R"#("VertexLitGeneric"
{
"$basetexture" "vgui/white"
"$envmap" "models/effects/crystal_cube_vertigo_hdr"
"$envmaptint" "[1 1 1]"
"$envmapfresnel" "1"
"$envmapfresnelminmaxexp" "[0 1 2]"
"$phong" "1"
"$reflectivity" "[2 2 2]"
"$bumpmap" "models/weapons/customization/materials/origamil_camo"
"$bumptransform" "center 0.5 0.5 scale 0.25 0.25 rotate 0.0 translate 0.0 0.0"
"Proxies"
{
"TextureScroll"
{
"textureScrollVar" "$bumptransform"
"textureScrollRate" "0.2"
"textureScrollAngle" "0.0"
}
}
})#");
materials[8] = create_material("space", "VertexLitGeneric", R"#("VertexLitGeneric"
{
"$basetexture" "dev/snowfield"
"$ignorez" "0"
"$envmap" ""
"$nofog" "1"
"$model" "1"
"$nocull" "0"
"$selfillum" "1"
"$halflambert" "1"
"$znearer" "0"
"$flat" "1"
"$reflectivity" "[1 1 1]"
Proxies
{
TextureScroll
{
"textureScrollVar" "$basetexturetransform"
"textureScrollRate" "0.05"
"textureScrollAngle" "0"
}
}
})#");
}
void features::chams::render(i_mat_render_context* ctx, const draw_model_state_t& state, const model_render_info_t& info, matrix_t* matrix)
{
if (!interfaces::engine->is_connected() || !interfaces::engine->is_in_game()) {
return;
}
bool is_player = strstr(info.model->name, "models/player") != nullptr;
bool is_arms = strstr(info.model->name, "arms") != nullptr;
bool is_sleeve = strstr(info.model->name, "sleeve") != nullptr;
bool is_weapon = strstr(info.model->name, "weapons/v_") != nullptr;
bool is_weapon_on_back = strstr(info.model->name, "_dropped.mdl") && strstr(info.model->name, "models/weapons/w") && !strstr(info.model->name, "arms") && !strstr(info.model->name, "ied_dropped");
bool is_weapon_enemy_hands = strstr(info.model->name, "models/weapons/w") && !strstr(info.model->name, "arms") && !strstr(info.model->name, "ied_dropped");
bool is_defuse_kit = strstr(info.model->name, "defuser") && !strstr(info.model->name, "arms") && !strstr(info.model->name, "ied_dropped");
if (is_player) {
entities(ctx, state, info, matrix);
}
if (is_weapon_on_back || is_weapon_enemy_hands || is_defuse_kit) {
attachments(ctx, state, info, matrix);
}
if (is_arms && !is_sleeve) {
arms(ctx, state, info, matrix);
}
if (is_weapon && !is_arms && !is_sleeve) {
weapons(ctx, state, info, matrix);
}
if (is_sleeve) {
sleeves(ctx, state, info, matrix);
}
}
void features::chams::entities(i_mat_render_context* ctx, const draw_model_state_t& state, const model_render_info_t& info, matrix_t* matrix)
{
auto entity = static_cast<player_t*>(interfaces::ent_list->get_client_entity(info.entity_index));
if (!entity || entity->dormant() || !entity->is_player()) {
return;
}
bool applied = false;
for (size_t i = 0; i < c::chams::entity_backtrack.materials.size(); ++i) {
if (c::chams::entity_backtrack.materials[i].enable && entity->team() != g::local->team()) {
auto record = &backtrack.data[entity->index()];
if (record->empty()) {
return;
}
if (applied || !c::chams::invisible_entity.hide_original_model) {
sdk::hooks::draw_model_execute::draw_model_execute_original(interfaces::model_render, 0, ctx, state, info, matrix);
}
if (c::chams::entity_backtrack.backtrack_materials[i].draw_all_ticks) {
for (size_t backtrack_ticks = 0; backtrack_ticks < record->size(); ++backtrack_ticks) {
if (record->at(backtrack_ticks).sim_time) {
float h, s, v, a;
h = (math::rgbtoh(c::chams::entity_backtrack.backtrack_materials[i].color_2[0], c::chams::entity_backtrack.backtrack_materials[i].color_2[1], c::chams::entity_backtrack.backtrack_materials[i].color_2[2]) - math::rgbtoh(c::chams::entity_backtrack.backtrack_materials[i].color_1[0], c::chams::entity_backtrack.backtrack_materials[i].color_1[1], c::chams::entity_backtrack.backtrack_materials[i].color_1[2])) / backtrack.data[entity->index()].size();
s = (math::rgbtos(c::chams::entity_backtrack.backtrack_materials[i].color_2[0], c::chams::entity_backtrack.backtrack_materials[i].color_2[1], c::chams::entity_backtrack.backtrack_materials[i].color_2[2]) - math::rgbtos(c::chams::entity_backtrack.backtrack_materials[i].color_1[0], c::chams::entity_backtrack.backtrack_materials[i].color_1[1], c::chams::entity_backtrack.backtrack_materials[i].color_1[2])) / backtrack.data[entity->index()].size();
v = (math::rgbtov(c::chams::entity_backtrack.backtrack_materials[i].color_2[0], c::chams::entity_backtrack.backtrack_materials[i].color_2[1], c::chams::entity_backtrack.backtrack_materials[i].color_2[2]) - math::rgbtov(c::chams::entity_backtrack.backtrack_materials[i].color_1[0], c::chams::entity_backtrack.backtrack_materials[i].color_1[1], c::chams::entity_backtrack.backtrack_materials[i].color_1[2])) / backtrack.data[entity->index()].size();
a = (c::chams::entity_backtrack.backtrack_materials[i].color_2[3] - c::chams::entity_backtrack.backtrack_materials[i].color_1[3]) / backtrack.data[entity->index()].size();
float hh, ss, vv;
hh = math::rgbtoh(c::chams::entity_backtrack.backtrack_materials[i].color_1[0], c::chams::entity_backtrack.backtrack_materials[i].color_1[1], c::chams::entity_backtrack.backtrack_materials[i].color_1[2]) + (h * i);
ss = math::rgbtos(c::chams::entity_backtrack.backtrack_materials[i].color_1[0], c::chams::entity_backtrack.backtrack_materials[i].color_1[1], c::chams::entity_backtrack.backtrack_materials[i].color_1[2]) + (s * i);
vv = math::rgbtov(c::chams::entity_backtrack.backtrack_materials[i].color_1[0], c::chams::entity_backtrack.backtrack_materials[i].color_1[1], c::chams::entity_backtrack.backtrack_materials[i].color_1[2]) + (v * i);
float fade_color[3] = { math::fromhsvtor(hh, ss, vv), math::fromhsvtog(hh, ss, vv), math::fromhsvtob(hh, ss, vv) };
color_t gradient = color_t(fade_color[0], fade_color[1], fade_color[2], c::chams::entity_backtrack.backtrack_materials[i].color_1[3] + (a * i));
override_material(c::chams::entity_backtrack.backtrack_materials[i].invisible, c::chams::entity_backtrack.backtrack_materials[i].material, c::chams::entity_backtrack.backtrack_materials[i].gradient ? gradient : color_t(c::chams::entity_backtrack.backtrack_materials[i].color_2[0], c::chams::entity_backtrack.backtrack_materials[i].color_2[1], c::chams::entity_backtrack.backtrack_materials[i].color_2[2], c::chams::entity_backtrack.backtrack_materials[i].color_2[3]));
sdk::hooks::draw_model_execute::draw_model_execute_original(interfaces::model_render, 0, ctx, state, info, backtrack.data[entity->index()][i].m_matrix);
interfaces::model_render->override_material(nullptr);
applied = true;
}
}
}
else {
if (record->front().sim_time) {
override_material(c::chams::entity_backtrack.backtrack_materials[i].invisible, c::chams::entity_backtrack.backtrack_materials[i].material, color_t(c::chams::entity_backtrack.backtrack_materials[i].color_2[0], c::chams::entity_backtrack.backtrack_materials[i].color_2[1], c::chams::entity_backtrack.backtrack_materials[i].color_2[2], c::chams::entity_backtrack.backtrack_materials[i].color_2[3]));
sdk::hooks::draw_model_execute::draw_model_execute_original(interfaces::model_render, 0, ctx, state, info, record->back().m_matrix);
interfaces::model_render->override_material(nullptr);
applied = true;
}
}
}
}
for (size_t i = 0; i < c::chams::local_entity.materials.size(); ++i) {
if (entity == g::local) {
if (c::chams::local_entity.materials[i].enable) {
if (applied || !c::chams::local_entity.hide_original_model) {
sdk::hooks::draw_model_execute::draw_model_execute_original(interfaces::model_render, 0, ctx, state, info, matrix);
}
override_material(false, c::chams::local_entity.materials[i].material, color_t(c::chams::local_entity.materials[i].color[0], c::chams::local_entity.materials[i].color[1], c::chams::local_entity.materials[i].color[2], c::chams::local_entity.materials[i].color[3]));
applied = true;
}
}
}
for (size_t i = 0; i < c::chams::invisible_entity.materials.size(); ++i) {
if (entity->team() != g::local->team()) {
if (c::chams::invisible_entity.materials[i].enable) {
if (applied || !c::chams::invisible_entity.hide_original_model) {
sdk::hooks::draw_model_execute::draw_model_execute_original(interfaces::model_render, 0, ctx, state, info, matrix);
}
override_material(true, c::chams::invisible_entity.materials[i].material, color_t(c::chams::invisible_entity.materials[i].color[0], c::chams::invisible_entity.materials[i].color[1], c::chams::invisible_entity.materials[i].color[2], c::chams::invisible_entity.materials[i].color[3]));
applied = true;
}
interfaces::model_render->override_material(nullptr);
if (c::chams::visible_entity.materials[i].enable) {
if (applied || !c::chams::visible_entity.hide_original_model) {
sdk::hooks::draw_model_execute::draw_model_execute_original(interfaces::model_render, 0, ctx, state, info, matrix);
}
override_material(false, c::chams::visible_entity.materials[i].material, color_t(c::chams::visible_entity.materials[i].color[0], c::chams::visible_entity.materials[i].color[1], c::chams::visible_entity.materials[i].color[2], c::chams::visible_entity.materials[i].color[3]));
applied = true;
}
}
}
}
void features::chams::attachments(i_mat_render_context* ctx, const draw_model_state_t& state, const model_render_info_t& info, matrix_t* matrix)
{
bool applied = false;
for (size_t i = 0; i < c::chams::invisible_attachment_entity.materials.size(); ++i) {
if (c::chams::invisible_attachment_entity.materials[i].enable) {
if (applied || !c::chams::invisible_attachment_entity.hide_original_model) {
sdk::hooks::draw_model_execute::draw_model_execute_original(interfaces::model_render, 0, ctx, state, info, matrix);
}
override_material(true, c::chams::invisible_attachment_entity.materials[i].material, color_t(c::chams::invisible_attachment_entity.materials[i].color[0], c::chams::invisible_attachment_entity.materials[i].color[1], c::chams::invisible_attachment_entity.materials[i].color[2], c::chams::invisible_attachment_entity.materials[i].color[3]));
applied = true;
}
}
interfaces::model_render->override_material(nullptr);
for (size_t i = 0; i < c::chams::visible_attachment_entity.materials.size(); ++i) {
if (c::chams::visible_attachment_entity.materials[i].enable) {
if (applied || !c::chams::visible_attachment_entity.hide_original_model) {
sdk::hooks::draw_model_execute::draw_model_execute_original(interfaces::model_render, 0, ctx, state, info, matrix);
}
override_material(false, c::chams::visible_attachment_entity.materials[i].material, color_t(c::chams::visible_attachment_entity.materials[i].color[0], c::chams::visible_attachment_entity.materials[i].color[1], c::chams::visible_attachment_entity.materials[i].color[2], c::chams::visible_attachment_entity.materials[i].color[3]));
applied = true;
}
}
}
void features::chams::arms(i_mat_render_context* ctx, const draw_model_state_t& state, const model_render_info_t& info, matrix_t* matrix)
{
bool applied = false;
for (size_t i = 0; i < c::chams::arms.materials.size(); ++i) {
if (c::chams::arms.materials[i].enable) {
if (applied || !c::chams::arms.hide_original_model) {
sdk::hooks::draw_model_execute::draw_model_execute_original(interfaces::model_render, 0, ctx, state, info, matrix);
}
override_material(false, c::chams::arms.materials[i].material, color_t(c::chams::arms.materials[i].color[0], c::chams::arms.materials[i].color[1], c::chams::arms.materials[i].color[2], c::chams::arms.materials[i].color[3]));
applied = true;
}
}
}
void features::chams::weapons(i_mat_render_context* ctx, const draw_model_state_t& state, const model_render_info_t& info, matrix_t* matrix)
{
if (g::local->is_scoped()) {
return;
}
bool applied = false;
for (size_t i = 0; i < c::chams::weapons.materials.size(); ++i) {
if (c::chams::weapons.materials[i].enable) {
if (applied || !c::chams::weapons.hide_original_model) {
sdk::hooks::draw_model_execute::draw_model_execute_original(interfaces::model_render, 0, ctx, state, info, matrix);
}
override_material(false, c::chams::weapons.materials[i].material, color_t(c::chams::weapons.materials[i].color[0], c::chams::weapons.materials[i].color[1], c::chams::weapons.materials[i].color[2], c::chams::weapons.materials[i].color[3]));
applied = true;
}
}
}
void features::chams::sleeves(i_mat_render_context* ctx, const draw_model_state_t& state, const model_render_info_t& info, matrix_t* matrix)
{
bool applied = false;
for (size_t i = 0; i < c::chams::sleeves.materials.size(); ++i) {
if (c::chams::sleeves.materials[i].enable) {
if (applied || !c::chams::sleeves.hide_original_model) {
sdk::hooks::draw_model_execute::draw_model_execute_original(interfaces::model_render, 0, ctx, state, info, matrix);
}
override_material(false, c::chams::sleeves.materials[i].material, color_t(c::chams::sleeves.materials[i].color[0], c::chams::sleeves.materials[i].color[1], c::chams::sleeves.materials[i].color[2], c::chams::sleeves.materials[i].color[3]));
applied = true;
}
}
}
void features::chams::old_shaders()
{
if (!c::chams::arms.old_shaders)
{
return;
}
if (!g::local || !interfaces::engine->is_connected() || !interfaces::engine->is_in_game())
{
return;
}
for (material_handle_t i = interfaces::material_system->first_material(); i != interfaces::material_system->invalid_material_handle(); i = interfaces::material_system->next_material(i))
{
i_material* material = interfaces::material_system->get_material(i);
if (!material)
continue;
const char* group = material->get_texture_group_name();
if (strstr(group, TEXTURE_GROUP_MODEL))
{
bool found = false;
auto rimlight = material->find_var("$rimlight", &found);
auto phong = material->find_var("$phong", &found);
if (found)
{
rimlight->set_int_value(0);
phong->set_int_value(0);
}
material->set_material_var_flag(material_var_basealphaenvmapmask, 0);
material->set_material_var_flag(material_var_normalmapalphaenvmapmask, 0);
material->set_material_var_flag(material_var_envmapmode, 0);
material->set_material_var_flag(material_var_halflambert, 1);
}
}
}
C++:
static const ctab cham_tabs[] =
{
ctab{ "enemy", []()
{
float group_w = ImGui::GetCurrentWindow()->Size.x - ImGui::GetStyle().ItemSpacing.x - ImGui::GetStyle().FramePadding.x * 2;
int material_working = c::menu::chams_menu_material - 1; // c::menu::chams_menu_material just integer
auto chams_settings = [&](std::string show, std::string hash, configuration_chams_data_t* settings) -> void {
if (ImGui::ArrowButton("##left", ImGuiDir_Left) && c::menu::chams_menu_material > 1) {
--c::menu::chams_menu_material;
}
ImGui::SameLine();
if (ImGui::ArrowButton("##right", ImGuiDir_Right) && c::menu::chams_menu_material < int(settings->materials.size())) {
++c::menu::chams_menu_material;
}
ImGui::Checkbox((show + std::to_string(c::menu::chams_menu_material)).c_str(), &settings->materials[material_working].enable);
if (settings->materials[material_working].enable) {
ImGui::SameLine();
bool open_popup = ImGui::Button(("+" + hash).c_str());
if (open_popup)
ImGui::OpenPopup((hash + "##popup").c_str());
if (ImGui::BeginPopup((hash + "##popup").c_str())) {
ImGui::Text("material");
ImGui::Combo(("##material" + hash).c_str(), &settings->materials[material_working].material, materials, ARRAYSIZE(materials));
ImGui::Checkbox(("hide original model" + hash).c_str(), &settings->hide_original_model);
ImGui::EndPopup();
}
}
};
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(ImGui::GetStyle().FramePadding.x, 0));
chams_settings("visible model", "##visiblemodel", &c::chams::visible_entity);
chams_settings("invisible model", "##invisiblemodel", &c::chams::invisible_entity);
chams_settings("visible attachment model", "##visibleattachmentmodel", &c::chams::visible_attachment_entity);
chams_settings("invisible attachment model", "##invisibleattachmentmodel", &c::chams::invisible_attachment_entity);
ImGui::PopStyleVar();
}},
ctab{ "backtrack", []()
{
float group_w = ImGui::GetCurrentWindow()->Size.x - ImGui::GetStyle().ItemSpacing.x - ImGui::GetStyle().FramePadding.x * 2;
int material_working = c::menu::chams_menu_material - 1;
auto chams_settings = [&](std::string show, std::string hash, configuration_chams_data_t* settings) -> void {
if (ImGui::ArrowButton("##left", ImGuiDir_Left) && c::menu::chams_menu_material > 1) {
--c::menu::chams_menu_material;
}
ImGui::SameLine();
ImGui::Text("%d", c::menu::chams_menu_material);
ImGui::SameLine();
if (ImGui::ArrowButton("##right", ImGuiDir_Right) && c::menu::chams_menu_material < int(settings->materials.size())) {
++c::menu::chams_menu_material;
}
ImGui::Checkbox(show.c_str(), &settings->materials[material_working].enable);
if (settings->materials[material_working].enable) {
ImGui::SameLine();
bool open_popup = ImGui::Button(("+" + hash).c_str());
if (open_popup)
ImGui::OpenPopup((hash + "##popup").c_str());
if (ImGui::BeginPopup((hash + "##popup").c_str())) {
ImGui::Combo(("##material" + hash).c_str(), &settings->materials[material_working].material, materials, ARRAYSIZE(materials));
ImGui::Checkbox(("hide original model" + hash).c_str(), &settings->hide_original_model);
ImGui::EndPopup();
}
}
};
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(ImGui::GetStyle().FramePadding.x, 0));
chams_settings("model", "##backtrackmodel", &c::chams::entity_backtrack);
ImGui::PopStyleVar();
}},
ctab{ "local", []()
{
float group_w = ImGui::GetCurrentWindow()->Size.x - ImGui::GetStyle().ItemSpacing.x - ImGui::GetStyle().FramePadding.x * 2;
int material_working = c::menu::chams_menu_material - 1;
auto chams_settings = [&](std::string show, std::string hash, configuration_chams_data_t* settings) -> void {
if (ImGui::ArrowButton("##left", ImGuiDir_Left) && c::menu::chams_menu_material > 1) {
--c::menu::chams_menu_material;
}
ImGui::SameLine();
ImGui::Text("%d", c::menu::chams_menu_material);
ImGui::SameLine();
if (ImGui::ArrowButton("##right", ImGuiDir_Right) && c::menu::chams_menu_material < int(settings->materials.size())) {
++c::menu::chams_menu_material;
}
ImGui::Checkbox(show.c_str(), &settings->materials[material_working].enable);
if (settings->materials[material_working].enable) {
ImGui::SameLine();
bool open_popup = ImGui::Button(("+" + hash).c_str());
if (open_popup)
ImGui::OpenPopup((hash + "##popup").c_str());
if (ImGui::BeginPopup((hash + "##popup").c_str())) {
ImGui::Combo(("##material" + hash).c_str(), &settings->materials[material_working].material, materials, ARRAYSIZE(materials));
ImGui::Checkbox(("hide original model" + hash).c_str(), &settings->hide_original_model);
ImGui::EndPopup();
}
}
};
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(ImGui::GetStyle().FramePadding.x, 0));
chams_settings("model", "##localmodel", &c::chams::local_entity);
chams_settings("weapons", "##weapons", &c::chams::weapons);
chams_settings("arms", "##arms", &c::chams::arms);
chams_settings("sleeves", "##sleeves", &c::chams::sleeves);
ImGui::PopStyleVar();
}},
ctab{ "team", []()
{
float group_w = ImGui::GetCurrentWindow()->Size.x - ImGui::GetStyle().ItemSpacing.x - ImGui::GetStyle().FramePadding.x * 2;
int material_working = c::menu::chams_menu_material - 1;
auto chams_settings = [&](std::string show, std::string hash, configuration_chams_data_t* settings) -> void {
if (ImGui::ArrowButton("##left", ImGuiDir_Left) && c::menu::chams_menu_material > 1) {
--c::menu::chams_menu_material;
}
ImGui::SameLine();
ImGui::Text("%d", c::menu::chams_menu_material);
ImGui::SameLine();
if (ImGui::ArrowButton("##right", ImGuiDir_Right) && c::menu::chams_menu_material < int(settings->materials.size())) {
++c::menu::chams_menu_material;
}
ImGui::Checkbox(show.c_str(), &settings->materials[material_working].enable);
if (settings->materials[material_working].enable) {
ImGui::SameLine();
bool open_popup = ImGui::Button(("+" + hash).c_str());
if (open_popup)
ImGui::OpenPopup((hash + "##popup").c_str());
if (ImGui::BeginPopup((hash + "##popup").c_str())) {
ImGui::Combo(("##material" + hash).c_str(), &settings->materials[material_working].material, materials, ARRAYSIZE(materials));
ImGui::Checkbox(("hide original model" + hash).c_str(), &settings->hide_original_model);
ImGui::EndPopup();
}
}
};
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(ImGui::GetStyle().FramePadding.x, 0));
chams_settings("visible model", "##visibleteammatesmodel", &c::chams::visible_teammates_entity);
chams_settings("invisible model", "##invisibleteammatesmodel", &c::chams::invisible_teammates_entity);
ImGui::PopStyleVar();
}}
};
menu::render_tab("chams_tabs", cham_tabs, 4U, &menu::chams_tab, style.Colors[ImGuiCol_TabHovered]);
C++:
struct chams_data_t {
bool enable = false;
int material = 0;
float color[4]{ 1.f, 1.f, 1.f, 1.f };
};
struct chams_backtrack_data_t {
bool gradient = false;
bool invisible = false;
bool draw_all_ticks = false;
int material = 0;
float color_1[4]{ 1.f, 1.f, 1.f, 1.f };
float color_2[4]{ 1.f, 1.f, 1.f, 1.f };
};
struct configuration_chams_data_t {
std::array<chams_data_t, 2> materials;
std::array<chams_backtrack_data_t, 2> backtrack_materials;
bool extended_render = false;
bool hide_original_model = false;
bool old_shaders = false;
};
namespace chams
{
inline configuration_chams_data_t local_entity;
inline configuration_chams_data_t visible_teammates_entity;
inline configuration_chams_data_t invisible_teammates_entity;
inline configuration_chams_data_t visible_entity;
inline configuration_chams_data_t invisible_entity;
inline configuration_chams_data_t visible_attachment_entity;
inline configuration_chams_data_t invisible_attachment_entity;
inline configuration_chams_data_t entity_backtrack;
inline configuration_chams_data_t weapons;
inline configuration_chams_data_t arms;
inline configuration_chams_data_t sleeves;
}
Последнее редактирование: