mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
vanilla skins only list now only shows vanilla skins
This commit is contained in:
parent
473048dac0
commit
63f2a091b6
|
@ -422,6 +422,7 @@ 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;
|
||||
s_InitSkinlist = true;
|
||||
}
|
||||
|
||||
Dummy.HSplitTop(20.0f, &DummyLabel, &Dummy);
|
||||
|
@ -535,6 +536,10 @@ void CMenus::RenderSettingsTee(CUIRect MainView)
|
|||
if((s->m_aName[0] == 'x' && s->m_aName[1] == '_'))
|
||||
continue;
|
||||
|
||||
// vanilla skins only
|
||||
if (g_Config.m_ClVanillaSkinsOnly && !s->m_IsVanilla)
|
||||
continue;
|
||||
|
||||
s_paSkinList.add(s);
|
||||
}
|
||||
s_InitSkinlist = false;
|
||||
|
|
|
@ -61,6 +61,8 @@ int CSkins::SkinScan(const char *pName, int IsDir, int DirType, void *pUser)
|
|||
|
||||
CSkin Skin;
|
||||
Skin.m_OrgTexture = pSelf->Graphics()->LoadTextureRaw(Info.m_Width, Info.m_Height, Info.m_Format, Info.m_pData, Info.m_Format, 0);
|
||||
|
||||
Skin.m_IsVanilla = IsVanillaSkin(aFilenameWithoutPng);
|
||||
|
||||
int BodySize = 96; // body size
|
||||
if (BodySize > Info.m_Height)
|
||||
|
@ -157,6 +159,7 @@ void CSkins::OnInit()
|
|||
{
|
||||
Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "gameclient", "failed to load skins. folder='skins/'");
|
||||
CSkin DummySkin;
|
||||
DummySkin.m_IsVanilla = true;
|
||||
DummySkin.m_OrgTexture = -1;
|
||||
DummySkin.m_ColorTexture = -1;
|
||||
str_copy(DummySkin.m_aName, "dummy", sizeof(DummySkin.m_aName));
|
||||
|
|
|
@ -16,6 +16,7 @@ public:
|
|||
int m_ColorTexture;
|
||||
char m_aName[24];
|
||||
vec3 m_BloodColor;
|
||||
bool m_IsVanilla;
|
||||
|
||||
bool operator<(const CSkin &Other) { return str_comp(m_aName, Other.m_aName) < 0; }
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue