mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Merge pull request #7576 from furo321/favourite-with-prefix
Fix bug when using favourites in combination with prefixes.
This commit is contained in:
commit
07fd8c1a48
|
@ -745,7 +745,7 @@ void CMenus::RenderSettingsTee(CUIRect MainView)
|
|||
|
||||
for(const auto &it : m_SkinFavorites)
|
||||
{
|
||||
const CSkin *pSkinToBeSelected = m_pClient->m_Skins.FindOrNullptr(it.c_str());
|
||||
const CSkin *pSkinToBeSelected = m_pClient->m_Skins.FindOrNullptr(it.c_str(), true);
|
||||
|
||||
if(pSkinToBeSelected == nullptr || !SkinNotFiltered(pSkinToBeSelected))
|
||||
continue;
|
||||
|
|
|
@ -373,14 +373,14 @@ const CSkin *CSkins::Find(const char *pName)
|
|||
}
|
||||
}
|
||||
|
||||
const CSkin *CSkins::FindOrNullptr(const char *pName)
|
||||
const CSkin *CSkins::FindOrNullptr(const char *pName, bool IgnorePrefix)
|
||||
{
|
||||
const char *pSkinPrefix = m_aEventSkinPrefix[0] ? m_aEventSkinPrefix : g_Config.m_ClSkinPrefix;
|
||||
if(g_Config.m_ClVanillaSkinsOnly && !IsVanillaSkin(pName))
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
else if(pSkinPrefix && pSkinPrefix[0])
|
||||
else if(pSkinPrefix && pSkinPrefix[0] && !IgnorePrefix)
|
||||
{
|
||||
char aBuf[24];
|
||||
str_format(aBuf, sizeof(aBuf), "%s_%s", pSkinPrefix, pName);
|
||||
|
|
|
@ -64,7 +64,7 @@ public:
|
|||
void Refresh(TSkinLoadedCBFunc &&SkinLoadedFunc);
|
||||
int Num();
|
||||
std::unordered_map<std::string_view, std::unique_ptr<CSkin>> &GetSkinsUnsafe() { return m_Skins; }
|
||||
const CSkin *FindOrNullptr(const char *pName);
|
||||
const CSkin *FindOrNullptr(const char *pName, bool IgnorePrefix = false);
|
||||
const CSkin *Find(const char *pName);
|
||||
|
||||
bool IsDownloadingSkins() { return m_DownloadingSkins; }
|
||||
|
|
Loading…
Reference in a new issue