-
Автор темы
- #1
C++:
void NightMode() {
static std::string old_Skyname = "";
static bool OldNightmode;
static int OldSky;
static int amount;
if (!g_pEngine->IsConnected() || !g_pEngine->IsInGame())
{
old_Skyname = "";
OldNightmode = false;
OldSky = 0;
amount = 0;
return;
}
static ConVar* r_DrawSpecificStaticProp;
if (OldNightmode != c_config::get().nightmode || amount != c_config::get().nightmode_amount)
{
r_DrawSpecificStaticProp = g_pCvar->FindVar("r_DrawSpecificStaticProp");
r_DrawSpecificStaticProp->SetValue(0);
for (MaterialHandle_t i = g_pMaterialSys->FirstMaterial(); i != g_pMaterialSys->InvalidMaterial(); i = g_pMaterialSys->NextMaterial(i))
{
IMaterial* pMaterial = g_pMaterialSys->GetMaterial(i);
if (!pMaterial)
continue;
if (strstr(pMaterial->GetTextureGroupName(), "World") || strstr(pMaterial->GetTextureGroupName(), "StaticProp"))
{
if (c_config::get().nightmode) {
LoadNamedSky("sky_csgo_night02");
pMaterial->ColorModulate(c_config::get().nightmode_amount / 255.f, c_config::get().nightmode_amount / 255.f, c_config::get().nightmode_amount / 255.f);
}
else {
LoadNamedSky("sky_cs15_daylight04_hdr");
pMaterial->ColorModulate(1.0f, 1.0f, 1.0f);
}
}
if (strstr(pMaterial->GetTextureGroupName(), "SkyBox"))
{
if (c_config::get().nightmode)
{
pMaterial->ColorModulate(180 / 255.f, 21 / 255.f, 212 / 255.f);
}
else
{
pMaterial->ColorModulate(1.0f, 1.0f, 1.0f);
LoadNamedSky("sky_cs15_daylight04_hdr");
}
}
}
OldNightmode = c_config::get().nightmode;
amount = c_config::get().nightmode_amount;
}
}
C++:
checkbox("NightMode", &c_config::get().nightmode);
if (c_config::get().nightmode)
{
slider(100, ("NightMode Amount"), &c_config::get().nightmode_amount, "%", 1);
}
Последнее редактирование: