GraphicPacksWindow: Disable update button when a game is running (#1137)

This commit is contained in:
goeiecool9999 2024-03-26 13:09:24 +01:00 committed by GitHub
parent 111e383d1b
commit 4f3d4624f5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 30 additions and 11 deletions

View file

@ -319,6 +319,7 @@ GraphicPacksWindow2::GraphicPacksWindow2(wxWindow* parent, uint64_t title_id_fil
SetSizer(main_sizer);
UpdateTitleRunning(CafeSystem::IsTitleRunning());
FillGraphicPackList();
}
@ -676,6 +677,15 @@ void GraphicPacksWindow2::OnInstalledGamesChanged(wxCommandEvent& event)
event.Skip();
}
void GraphicPacksWindow2::UpdateTitleRunning(bool running)
{
m_update_graphicPacks->Enable(!running);
if(running)
m_update_graphicPacks->SetToolTip(_("Graphic packs cannot be updated while a game is running."));
else
m_update_graphicPacks->SetToolTip(nullptr);
}
void GraphicPacksWindow2::ReloadPack(const GraphicPackPtr& graphic_pack) const
{
if (graphic_pack->HasShaders() || graphic_pack->HasPatches() || graphic_pack->HasCustomVSyncFrequency())