[censored]
-
Автор темы
- #1
Just got a working Night Mode for my paste finally... I couldn't get the other one working so I fixed it and I think alot of other people couldn't get it to work too so, I hope this works for you :)
Update: Fixed Night Mode lag. If you had it toggled in the menu it would print some errors to the console, but now it won't :)
Пожалуйста, зарегистрируйтесь или авторизуйтесь, чтобы увидеть содержимое.
Update: Fixed Night Mode lag. If you had it toggled in the menu it would print some errors to the console, but now it won't :)
Код:
void NightMode()
{
static bool bPerformed = false, bLastSetting;
if (Settings.GetSetting(Tab_Visuals, Visuals_NightMode)) {
ConVar* r_drawspecificstaticprop = Interfaces.g_ICVars->FindVar("r_drawspecificstaticprop");
SpoofedConvar* r_drawspecificstaticprop_s = new SpoofedConvar(r_drawspecificstaticprop);
r_drawspecificstaticprop_s->SetInt(0);
if (!bPerformed)
{
for (MaterialHandle_t i = Interfaces.pMaterialSystem->FirstMaterial(); i != Interfaces.pMaterialSystem->InvalidMaterial(); i = Interfaces.pMaterialSystem->NextMaterial(i))
{
IMaterial *pMaterial = Interfaces.pMaterialSystem->GetMaterial(i);
if (!pMaterial)
continue;
if (strstr(pMaterial->GetTextureGroupName(), "World")) {
pMaterial->ColorModulate(0.035, 0.035, 0.035);
}
if (strstr(pMaterial->GetTextureGroupName(), "StaticProp")) {
pMaterial->ColorModulate(0.12, 0.12, 0.12);
}
if (strstr(pMaterial->GetTextureGroupName(), "Model")) {
pMaterial->ColorModulate(0.40, 0.40, 0.40);
}
bPerformed = true;
}
}
}
if (bLastSetting != bLastSetting) {
bLastSetting = bLastSetting;
bPerformed = false;
}
}
Последнее редактирование: