mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-01 00:02:45 +03:00
feat(ui): implement Script_SetGamma
This commit is contained in:
parent
51e16dd5e3
commit
c91c86151b
@ -287,7 +287,17 @@ int32_t Script_GetGamma(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) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user