-
Автор темы
- #1
Ку, спастил себе скин ченджер по гайду с форума ( тык ) и при выводе таба со скинами игра крашит, итог дебага ниже.
void RenderSkinsTab() {
if (k_skins.size() == 0) {
initialize_kits();
}
auto& entries = Settings.skins.m_items;
static auto definition_vector_index = 0;
ImGui::Columns(2, nullptr, false);
{
ImGui::PushItemWidth(-1);
const auto wnd = ImGui::GetCurrentWindowRead();
float height = (wnd->Pos.y + wnd->Size.y) - wnd->DC.CursorPos.y - 18.0f - ImGui::GetStyle().WindowPadding.y - ImGui::GetStyle().FramePadding.y * 2.0f;
ImGui::ListBoxHeader("##config", ImVec2(0.f, height));
{
for (size_t w = 0; w < k_weapon_names.size(); w++) {
if (ImGui::Selectable(k_weapon_names[w].name, definition_vector_index == w)) {
definition_vector_index = w;
}
}
}
ImGui::ListBoxFooter();
if (ImGui::Button("Update"))
g_ClientState->ForceFullUpdate();
ImGui::PopItemWidth();
}
ImGui::NextColumn();
{
auto& selected_entry = entries[k_weapon_names[definition_vector_index].definition_index];
selected_entry.definition_index = k_weapon_names[definition_vector_index].definition_index;
selected_entry.definition_vector_index = definition_vector_index;
ImGui::Checkbox("Enabled", &selected_entry.enabled);
ImGui::InputInt("Seed", &selected_entry.seed);
ImGui::InputInt("StatTrak", &selected_entry.stat_trak);
ImGui::SliderFloat("Wear", &selected_entry.wear, FLT_MIN, 1.f, "%.10f", 5);
if (selected_entry.definition_index != GLOVE_T_SIDE) {
ImGui::Combo("Paint Kit", &selected_entry.paint_kit_vector_index, [](void* data, int idx, const char** out_text) {
*out_text = k_skins[idx].name.c_str();
return true;
}, nullptr, k_skins.size(), 20);
selected_entry.paint_kit_index = k_skins[selected_entry.paint_kit_vector_index].id;
}
else {
ImGui::Combo("Paint Kit", &selected_entry.paint_kit_vector_index, [](void* data, int idx, const char** out_text) {
*out_text = k_gloves[idx].name.c_str();
return true;
}, nullptr, k_gloves.size(), 20);
selected_entry.paint_kit_index = k_gloves[selected_entry.paint_kit_vector_index].id;
}
if (selected_entry.definition_index == WEAPON_KNIFE) {
ImGui::Combo("Knife", &selected_entry.definition_override_vector_index, [](void* data, int idx, const char** out_text) {
*out_text = k_knife_names.at(idx).name;
return true;
}, nullptr, k_knife_names.size(), 10);
selected_entry.definition_override_index = k_knife_names.at(selected_entry.definition_override_vector_index).definition_index;
}
else if (selected_entry.definition_index == GLOVE_T_SIDE) {
ImGui::Combo("Glove", &selected_entry.definition_override_vector_index, [](void* data, int idx, const char** out_text) {
*out_text = k_glove_names.at(idx).name;
return true;
}, nullptr, k_glove_names.size(), 10);
selected_entry.definition_override_index = k_glove_names.at(selected_entry.definition_override_vector_index).definition_index;
}
else {
static auto unused_value = 0;
selected_entry.definition_override_vector_index = 0;
ImGui::Combo("Unavailable", &unused_value, "For knives or gloves\0");
}
//ImGui::InputText( "Name Tag", selected_entry.custom_name, 32 );
}
ImGui::Columns(1, nullptr, false);
}
if (k_skins.size() == 0) {
initialize_kits();
}
auto& entries = Settings.skins.m_items;
static auto definition_vector_index = 0;
ImGui::Columns(2, nullptr, false);
{
ImGui::PushItemWidth(-1);
const auto wnd = ImGui::GetCurrentWindowRead();
float height = (wnd->Pos.y + wnd->Size.y) - wnd->DC.CursorPos.y - 18.0f - ImGui::GetStyle().WindowPadding.y - ImGui::GetStyle().FramePadding.y * 2.0f;
ImGui::ListBoxHeader("##config", ImVec2(0.f, height));
{
for (size_t w = 0; w < k_weapon_names.size(); w++) {
if (ImGui::Selectable(k_weapon_names[w].name, definition_vector_index == w)) {
definition_vector_index = w;
}
}
}
ImGui::ListBoxFooter();
if (ImGui::Button("Update"))
g_ClientState->ForceFullUpdate();
ImGui::PopItemWidth();
}
ImGui::NextColumn();
{
auto& selected_entry = entries[k_weapon_names[definition_vector_index].definition_index];
selected_entry.definition_index = k_weapon_names[definition_vector_index].definition_index;
selected_entry.definition_vector_index = definition_vector_index;
ImGui::Checkbox("Enabled", &selected_entry.enabled);
ImGui::InputInt("Seed", &selected_entry.seed);
ImGui::InputInt("StatTrak", &selected_entry.stat_trak);
ImGui::SliderFloat("Wear", &selected_entry.wear, FLT_MIN, 1.f, "%.10f", 5);
if (selected_entry.definition_index != GLOVE_T_SIDE) {
ImGui::Combo("Paint Kit", &selected_entry.paint_kit_vector_index, [](void* data, int idx, const char** out_text) {
*out_text = k_skins[idx].name.c_str();
return true;
}, nullptr, k_skins.size(), 20);
selected_entry.paint_kit_index = k_skins[selected_entry.paint_kit_vector_index].id;
}
else {
ImGui::Combo("Paint Kit", &selected_entry.paint_kit_vector_index, [](void* data, int idx, const char** out_text) {
*out_text = k_gloves[idx].name.c_str();
return true;
}, nullptr, k_gloves.size(), 20);
selected_entry.paint_kit_index = k_gloves[selected_entry.paint_kit_vector_index].id;
}
if (selected_entry.definition_index == WEAPON_KNIFE) {
ImGui::Combo("Knife", &selected_entry.definition_override_vector_index, [](void* data, int idx, const char** out_text) {
*out_text = k_knife_names.at(idx).name;
return true;
}, nullptr, k_knife_names.size(), 10);
selected_entry.definition_override_index = k_knife_names.at(selected_entry.definition_override_vector_index).definition_index;
}
else if (selected_entry.definition_index == GLOVE_T_SIDE) {
ImGui::Combo("Glove", &selected_entry.definition_override_vector_index, [](void* data, int idx, const char** out_text) {
*out_text = k_glove_names.at(idx).name;
return true;
}, nullptr, k_glove_names.size(), 10);
selected_entry.definition_override_index = k_glove_names.at(selected_entry.definition_override_vector_index).definition_index;
}
else {
static auto unused_value = 0;
selected_entry.definition_override_vector_index = 0;
ImGui::Combo("Unavailable", &unused_value, "For knives or gloves\0");
}
//ImGui::InputText( "Name Tag", selected_entry.custom_name, 32 );
}
ImGui::Columns(1, nullptr, false);
}
Вложения
-
187.2 KB Просмотры: 29