Почему не работает PushItemWidth?

dubdive

Следопыт
Сообщения
88
Реакции
5
есть какие то наводки в чем может быть дело?
C++:
    ImGui_ImplDX11_NewFrame();
    ImGui_ImplWin32_NewFrame();
    ImGui::NewFrame();
    ImGui::GetIO().MouseDrawCursor = menuopen;

    std::vector<std::string> Crash_name{"Null", "health pack", "Armour", "knife", "UZI", "DEAGLE", "RPG", "M4", "Sticky Bomb"};
    std::vector<std::string> aimbone{ "Head", "Chest"};
    std::string spawn = Crash_name[selectedPickuo];
    bool spawnweapon = 0, teleport = 0;
    char* modelpick = const_cast<char*>(spawn.c_str());
    char* boneid = const_cast<char*>(aimbone[AimbotID].c_str());
    ImGui::SetNextWindowSize({ 350.f, 600.f });
    if (menuopen)
    {
        if (!activated)
        {
            Activation();
            activated = true;
        }

    

        ImGui::PushFont(Logo);
        ImGui::Begin("Styn Lite v3", &menuopen, window_flags);

        //ImGui::PushStyleVar(ImGuiStyleVar_ChildRounding, 0.f);
        
        ImGui::SetCursorPos(ImVec2(0, 0));
        ImGui::Image(menu_background, ImVec2(350, 600), ImVec2(0, 0), ImVec2(1, 1), ImVec4(1, 1, 1, 0.80f));

        ImGui::SetCursorPos({ 11.f,110.f });
        ImGui::BeginChild("##MainPanel", ImVec2(328, 482), false);

        ImGui::SetCursorPos({ 18.f,35.f });
        ImGui::Checkbox("Semi-GodMode", &SemiGodModeLoop);
        ImGui::SetCursorPos({ 145.f,35.f });
        ImGui::Checkbox("Teleport at Waypoint", &teleport);
        ImGui::SetCursorPos({ 117.f,12.f });
        ImGui::PushItemWidth(84.000000);
        ImGui::Text("Self Options");
        ImGui::PopItemWidth();

        ImGui::SetCursorPos({ 146.f,67.f });
        ImGui::PushItemWidth(21.000000);
        ImGui::Text("ESP");
        ImGui::PopItemWidth();

        ImGui::SetCursorPos({ 130.f,120.f });
        ImGui::PushItemWidth(56.000000);
        ImGui::Text("Spawners");
        ImGui::PopItemWidth();

        ImGui::SetCursorPos({ 18.f,88.f });
        ImGui::Checkbox("Name Tags", &EspLoop);
        ImGui::SetCursorPos({ 127.f,88.f });
        ImGui::Checkbox("3D ESP", &ESP2);
        ImGui::SetCursorPos({ 210.f,88.f });
        ImGui::Checkbox("3D NPC ESP", &ESP3);

        ImGui::PushItemWidth(222.000000);
        {
            ImGui::SetCursorPos({ 83.f,143.f });
            ImGui::SliderInt(" Item Spawner", &selectedPickuo, 1, 8, modelpick);
        }
        ImGui::PopItemWidth();

        ImGui::SetCursorPos({ 18.f,143.f });
        if (ImGui::Button("Spawn", { 55.f,19.f }))
        {
            spawnweapon = true; spawnweapon = false;
        }
        ImGui::SetCursorPos({ 83.f,177.f });
        ImGui::PushItemWidth(223.000000);
        ImGui::InputText(" Vehicle Spawner", VehBuffer, 255);
        VehSpawnName = VehBuffer;

        ImGui::PopItemWidth();

        ImGui::SetCursorPos({ 18.f,177.f });
        if (ImGui::Button("Spawn", { 55.f,19.f }))
        {
            SpawnerVehbool = 1; SpawnerVehbool = 0;
        }
        ImGui::SetCursorPos({ 135.f,206.f });
        ImGui::PushItemWidth(49.000000);
        ImGui::Text("Aim Bot");
        ImGui::PopItemWidth();

        ImGui::SetCursorPos({ 18.f,228.f });
        ImGui::Checkbox("Enable Aimbot", &SettingsBool::enableaimbot);
        ImGui::SetCursorPos({ 172.f,228.f });
        ImGui::Checkbox("Memory Aim (UPD)", &SettingsBool::memoryaim);
        ImGui::SetCursorPos({ 18.f,265.f });
        ImGui::Checkbox("Draw FOV", &SettingsBool::fovenabled);
        ImGui::SetCursorPos({ 172.f,265.f });
        ImGui::Checkbox("Mouse Aim", &SettingsBool::mouseaim);
        ImGui::SetCursorPos({ 18.f,302.f });
        ImGui::PushItemWidth(280.000000);
        ImGui::SliderFloat("  FOV Size", &SettingsBool::fov, 1, 300);
        ImGui::PopItemWidth();

        ImGui::SetCursorPos({ 18.f,335.f });
        ImGui::PushItemWidth(287.000000);
        ImGui::SliderFloat("  Smoothing", &SettingsBool::smooth, 1.00, 100.00);
        ImGui::PopItemWidth();

        ImGui::SetCursorPos({ 239.f,461.f });
        ImGui::PushItemWidth(63.000000);
        ImGui::Text("Kill Menu");
        ImGui::PopItemWidth();

        ImGui::SetCursorPos({ 26.f,461.f });
        ImGui::PushItemWidth(84.000000);
        ImGui::Text("Styn Lite V4");
        ImGui::PopItemWidth();

        ImGui::SetCursorPos({ 18.f,355.f });
        ImGui::PushItemWidth(287.000000);
        ImGui::Combo("  Target", &selectedaim, aimtype, IM_ARRAYSIZE(aimtype));
        ImGui::PopItemWidth();


        //ImGui::PopStyleVar(1);
        ImGui::EndChild();


        ImGui::End();




        
    }
    if (spawnweapon)
    {
        SpawnPickup(selectedPickuo);
    }
    TeleportToW = teleport;
    if (killmenu)
    {
        scriptUnregister(main);
        keyboardHandlerUnregister(OnKeyboardMessage);
        kiero::shutdown();
    }
    if (SettingsBool::fovenabled)
    {
        ImGui::GetOverlayDrawList()->AddCircle(ImVec2(1920 / 2, 1080 / 2), SettingsBool::fov, IM_COL32(255, 255, 255, 255), 40.0f);
    }


      ImGui::EndFrame();
      ImGui::Render();
      pContext->OMSetRenderTargets(1, &mainRenderTargetView, NULL);
      ImGui_ImplDX11_RenderDrawData(ImGui::GetDrawData());
      return oPresent(pSwapChain, SyncInterval, Flags);
}
 

dubdive

Следопыт
Сообщения
88
Реакции
5
C++:
    ImGuiStyle* style = &ImGui::GetStyle();
    {
        style->WindowPadding = ImVec2(4, 4);
        style->WindowBorderSize = 0.f;
        style->ChildRounding = 0.f;
        style->FramePadding = ImVec2(8, 6);
        style->FrameRounding = 3.f;
        style->FrameBorderSize = 1.f;
        
    }
 

dubdive

Следопыт
Сообщения
88
Реакции
5
подгонял все в imgui билдере и там все супер влазит а на деле вот так потом
 

Darwin

Команда форума
Администратор
Сообщения
945
Реакции
513
Добавь
C++:
ImGui::Sameline()
 

dubdive

Следопыт
Сообщения
88
Реакции
5
Есть вероятность что там есть код конфликтующий с этим, но я незнаю что именно.
 

dubdive

Следопыт
Сообщения
88
Реакции
5
эх ладно буду делать без рескейла((
 

dubdive

Следопыт
Сообщения
88
Реакции
5
я разобрался, проблема в imgui builder, когда текст вставляешь в фейдер например то он меняет размер его в зависимости длины текста в нем а на деле когда в коде это игнорируется, поэтому по виду похоже что ничего не менялось.
p.s. текст справа от фейдера нарисовал отдельно.
 
Верх Низ