diff --git a/src/gui/wxgui/DownloadCustomGraphicPackWindow.cpp b/src/gui/wxgui/DownloadCustomGraphicPackWindow.cpp index d136b07f..f261061d 100644 --- a/src/gui/wxgui/DownloadCustomGraphicPackWindow.cpp +++ b/src/gui/wxgui/DownloadCustomGraphicPackWindow.cpp @@ -121,12 +121,6 @@ DownloadCustomGraphicPackWindow::~DownloadCustomGraphicPackWindow() int DownloadCustomGraphicPackWindow::ShowModal() { - if (CafeSystem::IsTitleRunning()) - { - wxMessageBox(_("Graphic packs cannot be updated while a game is running."), _("Graphic packs"), 5, this); - return wxID_CANCEL; - } - wxDialog::ShowModal(); return wxID_OK; } diff --git a/src/gui/wxgui/GraphicPacksWindow2.cpp b/src/gui/wxgui/GraphicPacksWindow2.cpp index 9ac52304..21e25b07 100644 --- a/src/gui/wxgui/GraphicPacksWindow2.cpp +++ b/src/gui/wxgui/GraphicPacksWindow2.cpp @@ -304,13 +304,13 @@ GraphicPacksWindow2::GraphicPacksWindow2(wxWindow* parent, uint64_t title_id_fil auto* row = new wxBoxSizer(wxHORIZONTAL); - m_download_from_url = new wxButton(m_right_panel, wxID_ANY, _("Download pack from URL")); - m_download_from_url->Bind(wxEVT_BUTTON, &GraphicPacksWindow2::OnClickCustomDownload, this); - row->Add(m_download_from_url, 0, wxALL, 5); - m_update_graphicPacks = new wxButton(m_right_panel, wxID_ANY, _("Download latest community graphic packs")); m_update_graphicPacks->Bind(wxEVT_BUTTON, &GraphicPacksWindow2::OnCheckForUpdates, this); - row->Add(m_update_graphicPacks, 0, wxALL, 5); + row->Add(m_update_graphicPacks, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5); + + m_download_from_url = new wxHyperlinkCtrl(m_right_panel, wxID_ANY, _("Or download pack from URL..."), _("")); + m_download_from_url->Bind(wxEVT_HYPERLINK, &GraphicPacksWindow2::OnClickCustomDownload, this); + row->Add(m_download_from_url, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5); sizer->Add(row, 0, wxALL | wxEXPAND, 5); @@ -608,7 +608,7 @@ void GraphicPacksWindow2::OnReloadShaders(wxCommandEvent& event) void GraphicPacksWindow2::OnClickCustomDownload(wxCommandEvent& event) { DownloadCustomGraphicPackWindow frame(this); - if (frame.ShowModal() == wxID_OK && !CafeSystem::IsTitleRunning()) + if (frame.ShowModal() == wxID_OK) { RefreshGraphicPacks(); FillGraphicPackList(); @@ -700,10 +700,17 @@ void GraphicPacksWindow2::OnInstalledGamesChanged(wxCommandEvent& event) void GraphicPacksWindow2::UpdateTitleRunning(bool running) { m_update_graphicPacks->Enable(!running); + m_download_from_url->Enable(!running); if(running) + { + m_download_from_url->SetToolTip(_("Graphic packs cannot be updated while a game is running.")); m_update_graphicPacks->SetToolTip(_("Graphic packs cannot be updated while a game is running.")); + } else + { m_update_graphicPacks->SetToolTip(nullptr); + m_download_from_url->SetToolTip(nullptr); + } } void GraphicPacksWindow2::ReloadPack(const GraphicPackPtr& graphic_pack) const diff --git a/src/gui/wxgui/GraphicPacksWindow2.h b/src/gui/wxgui/GraphicPacksWindow2.h index 0d24e87b..bf8647de 100644 --- a/src/gui/wxgui/GraphicPacksWindow2.h +++ b/src/gui/wxgui/GraphicPacksWindow2.h @@ -1,9 +1,9 @@ #pragma once -#include #include #include #include +#include #include "wxcomponents/checktree.h" @@ -46,7 +46,7 @@ private: wxBoxSizer* m_preset_sizer; std::vector m_active_preset; wxButton* m_reload_shaders; - wxButton* m_download_from_url; + wxHyperlinkCtrl* m_download_from_url; wxButton* m_update_graphicPacks; wxInfoBar* m_info_bar;