feat(ui): implement Script_SetGamma

This commit is contained in:
fallenoak 2025-11-30 23:52:50 -06:00
parent 51e16dd5e3
commit c91c86151b
No known key found for this signature in database
GPG Key ID: 7628F8E61AEA070D

View File

@ -287,7 +287,17 @@ int32_t Script_GetGamma(lua_State* L) {
} }
int32_t Script_SetGamma(lua_State* L) { int32_t Script_SetGamma(lua_State* L) {
WHOA_UNIMPLEMENTED(0); if (!lua_isnumber(L, 1)) {
return luaL_error(L, "Usage: SetGamma(value)");
}
char gammaStr[16];
SStrPrintf(gammaStr, sizeof(gammaStr), "%f", 1.0 - lua_tonumber(L, 1));
auto gammaVar = CVar::Lookup("gamma");
gammaVar->Set(gammaStr, true, false, false, true);
return 0;
} }
int32_t Script_GetTerrainMip(lua_State* L) { int32_t Script_GetTerrainMip(lua_State* L) {