vanilla skins only list now only shows vanilla skins

This commit is contained in:
fokkonaut 2018-07-25 14:13:07 +02:00
parent 473048dac0
commit 63f2a091b6
3 changed files with 9 additions and 0 deletions

View file

@ -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;

View file

@ -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));

View file

@ -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; }
};