From 46ddaf9b01f1c6ecb47fe84e88fa593d345a5021 Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Sun, 12 Feb 2023 20:30:35 +0100 Subject: [PATCH] Add ability to deselect a map in the SDK launcher --- r5dev/sdklauncher/basepanel.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/r5dev/sdklauncher/basepanel.cpp b/r5dev/sdklauncher/basepanel.cpp index 6b55d5df..407fba17 100644 --- a/r5dev/sdklauncher/basepanel.cpp +++ b/r5dev/sdklauncher/basepanel.cpp @@ -59,7 +59,7 @@ void CUIBaseSurface::Init() this->m_MapCombo->SetSize({ 347, 25 }); this->m_MapCombo->SetLocation({ 15, 25 }); this->m_MapCombo->SetTabIndex(0); - this->m_MapCombo->SetSelectedIndex(-1); + this->m_MapCombo->SetSelectedIndex(0); this->m_MapCombo->SetAnchor(Forms::AnchorStyles::Top | Forms::AnchorStyles::Left); this->m_MapCombo->SetDropDownStyle(Forms::ComboBoxStyle::DropDownList); this->m_GameGroup->AddControl(this->m_MapCombo); @@ -77,7 +77,7 @@ void CUIBaseSurface::Init() this->m_PlaylistCombo->SetSize({ 347, 25 }); this->m_PlaylistCombo->SetLocation({ 15, 50 }); this->m_PlaylistCombo->SetTabIndex(0); - this->m_PlaylistCombo->SetSelectedIndex(-1); + this->m_PlaylistCombo->SetSelectedIndex(0); this->m_PlaylistCombo->SetAnchor(Forms::AnchorStyles::Top | Forms::AnchorStyles::Left); this->m_PlaylistCombo->SetDropDownStyle(Forms::ComboBoxStyle::DropDownList); this->m_GameGroup->AddControl(this->m_PlaylistCombo); @@ -569,6 +569,7 @@ void CUIBaseSurface::ParseMaps() std::regex rgArchiveRegex{ R"([^_]*_(.*)(.bsp.pak000_dir).*)" }; std::smatch smRegexMatches; + m_MapCombo->Items.Add(""); for (const fs::directory_entry& dEntry : fsDir) { std::string svFileName = dEntry.path().u8string(); @@ -604,6 +605,7 @@ void CUIBaseSurface::ParsePlaylists() const string svBaseDir = "platform\\"; fs::path fsPlaylistPath(svBaseDir + this->m_PlaylistFileTextBox->Text().ToCString()); + m_PlaylistCombo->Items.Add(""); if (fs::exists(fsPlaylistPath)) { bool bOk{ };