Skip to content

Commit

Permalink
another fix/tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
Xsintashi committed Dec 20, 2022
1 parent 89ee11c commit ae7fb9f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Lib/imgui/imgui_draw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ void ImGui::StyleColorsSourceVGUI(ImGuiStyle* dst) {
colors[ImGuiCol_Separator] = ImVec4(.17f, 0.17f, 0.17, 1.f);
colors[ImGuiCol_SliderGrabActive] = ImVec4(0.424f, 0.424f, 0.424f, 1.f);
colors[ImGuiCol_SliderGrab] = ImVec4(0.424f, 0.424f, 0.424f, 1.f);
colors[ImGuiCol_TextSelectedBg] = ImVec4(0.463f, 0.463f, 0.463f, 1.f);
colors[ImGuiCol_TextSelectedBg] = ImVec4(0.243f, 0.243f, 0.243f, 1.00f);
colors[ImGuiCol_PopupBg] = ImVec4(0.635f, 0.635f, 0.635f, 1.f);
colors[ImGuiCol_CustomButtonOne] = ImVec4(0.17f, 0.17f, 0.17f, 1.f);
colors[ImGuiCol_CustomButtonTwo] = ImVec4(0.7f, 0.7f, 0.7f, 1.f);
Expand Down
22 changes: 16 additions & 6 deletions Source/GUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@ void GUI::windowVisibility(int mode) noexcept {
ShowWindow(window, mode);
}

void updateStyle() {
if (cfg->guiStyle)
ImGui::StyleColorsSourceVGUI();
else
ImGui::StyleColorsGoldSourceVGUI();
}

void GUI::CreateHWindow(const char* windowName) noexcept
{
Expand Down Expand Up @@ -201,10 +207,7 @@ void GUI::CreateImGui() noexcept

io.IniFilename = NULL;

if(cfg->guiStyle)
ImGui::StyleColorsSourceVGUI();
else
ImGui::StyleColorsGoldSourceVGUI();
updateStyle();

ImGui_ImplWin32_Init(window);
ImGui_ImplDX9_Init(device);
Expand Down Expand Up @@ -316,8 +319,11 @@ void GUI::Render() noexcept
static std::string notExist = "";
static bool exist = true;
ImGui::PushStyleColor(ImGuiCol_FrameBg, ImGui::GetColorU32(ImGuiCol_ChildBg));
if(cfg->guiStyle)
ImGui::PushStyleColor(ImGuiCol_TextSelectedBg, ImVec4(0.463f, 0.463f, 0.463f, 1.f));
ImGui::SetNextItemWidth(223.f);
ImGui::InputText("", &configID);
ImGui::PopStyleColor();
ImGui::PopStyleColor(cfg->guiStyle ? 2 : 1);
if (!exist) {
ImGui::TextWrapped("%s config doesn't exist", notExist.c_str());
}
Expand All @@ -329,6 +335,7 @@ void GUI::Render() noexcept
if (ImGui::Button("Load")) {
if (std::ifstream file(configID); file.good()) {
cfg->Load(configID);
updateStyle();
exist = true;
ImGui::CloseCurrentPopup();
} else {
Expand Down Expand Up @@ -623,8 +630,11 @@ void GUI::Render() noexcept

ImGui::SetNextItemWidth(width - static_cast<int>(ImGui::CalcTextSize(buttonText.c_str()).x) - 34.f);
ImGui::PushStyleColor(ImGuiCol_FrameBg, ImGui::GetColorU32(ImGuiCol_ChildBg));
if (cfg->guiStyle)
ImGui::PushStyleColor(ImGuiCol_TextSelectedBg, ImVec4(0.463f, 0.463f, 0.463f, 1.f));

ImGui::InputText("##output", &global->gameArgs, ImGuiInputTextFlags_ReadOnly);
ImGui::PopStyleColor();
ImGui::PopStyleColor(cfg->guiStyle ? 2 : 1);
sameLine
if (isSteamRunning() || FindWindowW(L"Valve001", nullptr)) {
ImGui::BeginDisabled();
Expand Down
Binary file modified assets/menu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ae7fb9f

Please sign in to comment.