mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
parent
b8b97eb740
commit
d08f03fecf
|
@ -367,8 +367,6 @@ void CMenus::RenderSettingsTee(CUIRect MainView)
|
|||
{
|
||||
CUIRect Button, Label, Button2, Dummy, DummyLabel, SkinList, QuickSearch, QuickSearchClearButton, SkinPrefix, SkinPrefixLabel;
|
||||
|
||||
bool CheckSettings = false;
|
||||
static int s_ClVanillaSkinsOnly = g_Config.m_ClVanillaSkinsOnly;
|
||||
static float s_ClSkinPrefix = 0.0f;
|
||||
|
||||
static bool s_InitSkinlist = true;
|
||||
|
@ -424,7 +422,6 @@ void CMenus::RenderSettingsTee(CUIRect MainView)
|
|||
if(DoButton_CheckBox(&g_Config.m_ClVanillaSkinsOnly, Localize("Vanilla skins only"), g_Config.m_ClVanillaSkinsOnly, &DummyLabel))
|
||||
{
|
||||
g_Config.m_ClVanillaSkinsOnly ^= 1;
|
||||
CheckSettings = true;
|
||||
}
|
||||
|
||||
Dummy.HSplitTop(20.0f, &DummyLabel, &Dummy);
|
||||
|
@ -440,14 +437,6 @@ void CMenus::RenderSettingsTee(CUIRect MainView)
|
|||
SkinPrefix.HSplitTop(20.0f, &SkinPrefixLabel, &SkinPrefix);
|
||||
DoEditBox(g_Config.m_ClSkinPrefix, &SkinPrefixLabel, g_Config.m_ClSkinPrefix, sizeof(g_Config.m_ClSkinPrefix), 14.0f, &s_ClSkinPrefix);
|
||||
|
||||
if(CheckSettings)
|
||||
{
|
||||
if(s_ClVanillaSkinsOnly == g_Config.m_ClVanillaSkinsOnly)
|
||||
m_NeedRestartSkins = false;
|
||||
else
|
||||
m_NeedRestartSkins = true;
|
||||
}
|
||||
|
||||
Dummy.HSplitTop(20.0f, &DummyLabel, &Dummy);
|
||||
|
||||
MainView.HSplitTop(50.0f, &Label, &MainView);
|
||||
|
|
|
@ -40,11 +40,6 @@ int CSkins::SkinScan(const char *pName, int IsDir, int DirType, void *pUser)
|
|||
str_copy(aFilenameWithoutPng, pName, sizeof(aFilenameWithoutPng));
|
||||
aFilenameWithoutPng[str_length(aFilenameWithoutPng) - 4] = 0;
|
||||
|
||||
if(g_Config.m_ClVanillaSkinsOnly && !IsVanillaSkin(aFilenameWithoutPng))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Don't add duplicate skins (one from user's config directory, other from
|
||||
// client itself)
|
||||
for(int i = 0; i < pSelf->Num(); i++)
|
||||
|
@ -203,10 +198,17 @@ int CSkins::FindImpl(const char *pName) const
|
|||
for(int i = 0; i < m_aSkins.size(); i++)
|
||||
{
|
||||
if(str_comp(m_aSkins[i].m_aName, pName) == 0)
|
||||
{
|
||||
if(g_Config.m_ClVanillaSkinsOnly && !IsVanillaSkin(m_aSkins[i].m_aName))
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return i;
|
||||
}
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue