From 20c35c8d8e71e7850519c91ca95a2cac7d4d15ee Mon Sep 17 00:00:00 2001 From: William JCM Date: Fri, 5 Mar 2021 14:20:02 +0100 Subject: [PATCH] MainFrame: upgrade the default profile logic. --- GUI/EvtMainFrame.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/GUI/EvtMainFrame.cpp b/GUI/EvtMainFrame.cpp index d3b2a81..cf6d4e3 100644 --- a/GUI/EvtMainFrame.cpp +++ b/GUI/EvtMainFrame.cpp @@ -78,14 +78,23 @@ EvtMainFrame::EvtMainFrame(wxWindow* parent): return; } + std::size_t default_profile = 0; + int counter = 0; + for(const Profile& p : _profileManager.profiles()) { if(p.valid()) { _profileChoice->Append(wxString::Format("%s%s", p.companyName(), p.type() == ProfileType::Demo ? " (Demo)" : "")); + + if(p.type() == ProfileType::FullGame && default_profile == 0) { + default_profile = counter; + } + + counter++; } } - _profileManager.setProfile(0); - _profileChoice->SetSelection(0); + _profileManager.setProfile(default_profile); + _profileChoice->SetSelection(default_profile); _massManager.emplace(_profileManager.profileDirectory(), _profileManager.currentProfile()->steamId(),